Skip to content

Commit

Permalink
Remove high level optimization warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed Mar 15, 2024
1 parent 9763609 commit 3781020
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 49 deletions.
12 changes: 0 additions & 12 deletions numba_dpex/kernel_api_impl/spirv/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ def inline_threshold(self, value: int):
)
self._inline_threshold = 0
else:
if value == 3:
warnings.warn(
"Due to an existing compiler bug, setting INLINE_THRESHOLD "
f"to {value} can lead to incorrect code generation on "
"certain devices."
)
self._inline_threshold = value

def _optimize_final_module(self):
Expand All @@ -69,12 +63,6 @@ def _optimize_final_module(self):

# Make optimization level depending on config.DPEX_OPT variable
pmb.opt_level = config.DPEX_OPT
if config.DPEX_OPT > 2:
warnings.warn(
"Setting NUMBA_DPEX_OPT greater than 2 known to cause issues "
+ "related to very aggressive optimizations that leads to "
+ "broken code."
)

pmb.disable_unit_at_a_time = False

Expand Down
17 changes: 0 additions & 17 deletions numba_dpex/tests/experimental/test_compiler_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0

import dpctl
import pytest
from numba.core import types

from numba_dpex import DpctlSyclQueue, DpnpNdArray
from numba_dpex import experimental as dpex_exp
from numba_dpex import int64
from numba_dpex.core.types.kernel_api.index_space_ids import ItemType
from numba_dpex.kernel_api import Item


Expand All @@ -21,15 +16,3 @@ def _kernel(item: Item, a, b, c):
def test_compilation_mode_option_user_definition():
with pytest.warns(UserWarning):
dpex_exp.kernel(_compilation_mode="kernel")(_kernel)


def test_inline_threshold_level_warning():
"""
Test compiler warning generation with an inline_threshold value of 3.
"""

with pytest.warns(UserWarning):
queue_ty = DpctlSyclQueue(dpctl.SyclQueue())
i64arr_ty = DpnpNdArray(ndim=1, dtype=int64, layout="C", queue=queue_ty)
kernel_sig = types.void(ItemType(1), i64arr_ty, i64arr_ty, i64arr_ty)
dpex_exp.kernel(inline_threshold=3)(_kernel).compile(kernel_sig)
20 changes: 0 additions & 20 deletions numba_dpex/tests/misc/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,6 @@ def foo(a):
a[dpex.get_global_id(0)] = 0


def test_opt_warning():
bkp = config.DPEX_OPT
config.DPEX_OPT = 3

with pytest.warns(UserWarning):
dpex.call_kernel(foo, dpex.Range(10), dpnp.arange(10))

config.DPEX_OPT = bkp


def test_inline_threshold_eq_3_warning():
bkp = config.INLINE_THRESHOLD
config.INLINE_THRESHOLD = 3

with pytest.warns(UserWarning):
dpex.call_kernel(foo, dpex.Range(10), dpnp.arange(10))

config.INLINE_THRESHOLD = bkp


def test_inline_threshold_negative_val_warning_():
bkp = config.INLINE_THRESHOLD
config.INLINE_THRESHOLD = -1
Expand Down

0 comments on commit 3781020

Please sign in to comment.