From c715e2b7a3f352116df68b6c6484cf0d92d6247e Mon Sep 17 00:00:00 2001 From: Diptorup Deb Date: Sun, 26 Feb 2023 22:36:43 -0600 Subject: [PATCH] Do not print performance waarning for internal compilation. --- driver.py | 5 +++-- numba_dpex/dpnp_iface/arrayobj.py | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/driver.py b/driver.py index 861e6a1e87..16fbf04f05 100644 --- a/driver.py +++ b/driver.py @@ -24,13 +24,14 @@ def vecadd_prange(a, b): # def sin(a): # return np.sin(a) -a = dpnp.ones(10, dtype=dpnp.int64, usm_type="shared") -b = dpnp.ones(10, dtype=dpnp.int64, usm_type="shared") +a = dpnp.ones(1024, dtype=dpnp.int64, usm_type="shared") +b = dpnp.ones(1024, dtype=dpnp.int64, usm_type="shared") print(a) c = vecadd(a, b) print(c) +print(c.usm_type) # s = vecadd_prange(a, b) # a = sin(a) diff --git a/numba_dpex/dpnp_iface/arrayobj.py b/numba_dpex/dpnp_iface/arrayobj.py index 5aa019637b..e09dd754f9 100644 --- a/numba_dpex/dpnp_iface/arrayobj.py +++ b/numba_dpex/dpnp_iface/arrayobj.py @@ -7,6 +7,7 @@ from llvmlite.ir import Constant from numba import errors, types from numba.core import cgutils +from numba.core import config as numba_config from numba.core.types.scalars import Float from numba.core.typing import signature from numba.core.typing.npydecl import parse_dtype as ty_parse_dtype @@ -185,12 +186,18 @@ def impl(cls, allocsize, usm_type, device): return impl +numba_config.DISABLE_PERFORMANCE_WARNINGS = 0 + + @dpjit def _call_usm_allocator(arrtype, size, usm_type, device): """Trampoline to call the intrinsic used for allocation""" return arrtype._usm_allocate(size, usm_type, device) +numba_config.DISABLE_PERFORMANCE_WARNINGS = 1 + + @intrinsic def intrin_usm_alloc(typingctx, allocsize, usm_type, device): """Intrinsic to call into the allocator for Array"""