Skip to content

Commit 38edc59

Browse files
author
Diptorup Deb
committed
Unit to test if warning raised if compilation mode set by user.
1 parent 06d379e commit 38edc59

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
import warnings
6+
7+
import pytest
8+
9+
import numba_dpex as dpex
10+
from numba_dpex import experimental as dpex_exp
11+
12+
13+
def test_compilation_mode_option_user_definition():
14+
def kernel_func(a, b, c):
15+
i = dpex.get_global_id(0)
16+
c[i] = a[i] + b[i]
17+
18+
with pytest.warns(warnings.warn(UserWarning)):
19+
dpex_exp.kernel(_compilation_mode="kernel")(kernel_func)

0 commit comments

Comments
 (0)