Skip to content

Commit

Permalink
Modifications...
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Nov 21, 2023
1 parent 0c41c71 commit 63c3f22
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion numba_dpex/experimental/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def _specialized_kernel_dispatcher(pyfunc):
return _kernel_dispatcher(func)


jit_registry[target_registry["dpex_kernel"]] = kernel
jit_registry[target_registry[DPEX_KERNEL_EXP_TARGET_NAME]] = kernel
2 changes: 1 addition & 1 deletion numba_dpex/experimental/kernel_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _compile_cached(

except errors.TypingError as e:
self._failed_cache[key] = e
return _KernelCompileResult(False, e, None)
return False, e

return True, _KernelCompileResult(*kcres_attrs)

Expand Down
15 changes: 15 additions & 0 deletions numba_dpex/experimental/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
numba_dpex.experimental module.
"""

from numba.core import types
from numba.core.datamodel import DataModelManager, models
from numba.core.extending import register_model

import numba_dpex.core.datamodel.models as dpex_core_models
from numba_dpex.core.types import Array, DpctlSyclQueue, DpnpNdArray, USMNdArray

from .types import KernelDispatcherType

Expand All @@ -26,7 +28,20 @@ def _init_exp_data_model_manager() -> DataModelManager:
"""

dmm = dpex_core_models.dpex_data_model_manager.copy()
dmm.register(types.CPointer, dpex_core_models.GenericPointerModel)
dmm.register(Array, dpex_core_models.USMArrayModel)

# Register the USMNdArray type to USMArrayModel in numba_dpex's data model
# manager. The dpex_data_model_manager is used by the DpexKernelTarget
dmm.register(USMNdArray, dpex_core_models.USMArrayModel)

# Register the DpnpNdArray type to USMArrayModel in numba_dpex's data model
# manager. The dpex_data_model_manager is used by the DpexKernelTarget
dmm.register(DpnpNdArray, dpex_core_models.USMArrayModel)

# Register the DpctlSyclQueue type to SyclQueueModel in numba_dpex's data
# model manager. The dpex_data_model_manager is used by the DpexKernelTarget
dmm.register(DpctlSyclQueue, dpex_core_models.SyclQueueModel)
return dmm


Expand Down

0 comments on commit 63c3f22

Please sign in to comment.