Skip to content

Commit b3af405

Browse files
authored
Get rid of gpu kernel api stubs (#203)
1 parent dd25045 commit b3af405

File tree

4 files changed

+13
-104
lines changed

4 files changed

+13
-104
lines changed

dpcomp_gpu_runtime/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ endif()
2222

2323
set(SOURCES_LIST
2424
lib/gpu_runtime.cpp
25-
lib/kernel_api_stubs.cpp
2625
)
2726
set(HEADERS_LIST
2827
lib/level_zero_printing.hpp

dpcomp_gpu_runtime/lib/kernel_api_stubs.cpp

Lines changed: 0 additions & 96 deletions
This file was deleted.

numba_dpcomp/numba_dpcomp/mlir/gpu_runtime.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,25 @@ def _register_funcs():
4545
mlir_func_name("get_local_id"),
4646
mlir_func_name("get_global_size"),
4747
mlir_func_name("get_local_size"),
48+
mlir_func_name("kernel_barrier"),
49+
mlir_func_name("kernel_mem_fence"),
4850
]
4951

50-
_atomic_ops = ["add", "sub"]
51-
_atomic_ops_types = ["int32", "int64", "float32", "float64"]
52-
5352
from itertools import product
5453

55-
for o, t in product(_atomic_ops, _atomic_ops_types):
56-
_funcs.append(mlir_func_name("atomic_" + o + "_" + t))
54+
_types = ["int32", "int64", "float32", "float64"]
55+
_atomic_ops = ["add", "sub"]
56+
for o, t in product(_atomic_ops, _types):
57+
_funcs.append(mlir_func_name(f"atomic_{o}_{t}"))
58+
59+
for n, t in product(range(8), _types):
60+
_funcs.append(mlir_func_name(f"local_array_{t}_{n}"))
5761

5862
for name in _funcs:
59-
func = getattr(runtime_lib, name)
63+
if hasattr(runtime_lib, name):
64+
func = getattr(runtime_lib, name)
65+
else:
66+
func = 1
6067
register_cfunc(ll, name, func)
6168

6269
_alloc_func = runtime_lib.dpcompGpuSetMemInfoAllocFunc

numba_dpcomp/numba_dpcomp/mlir/tests/test_numba_parfor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ def _gen_tests():
135135
"test_namedtuple3", # namedtuple
136136
"test_issue6102", # list support
137137
"test_oversized_tuple_as_arg_to_kernel", # UnsupportedParforsError not raised
138-
"test_issue5942_2", # invalid result
139138
"test_parfor_ufunc_typing", # np.isinf
140139
"test_issue_5098", # list support and more
141140
"test_ufunc_expr", # np.bitwise_and(

0 commit comments

Comments
 (0)