Skip to content

Commit

Permalink
Do not print performance waarning for internal compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
diptorupd committed Feb 27, 2023
1 parent b2f5583 commit c715e2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions numba_dpex/dpnp_iface/arrayobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
Expand Down

0 comments on commit c715e2b

Please sign in to comment.