Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Use TargetDispatcher from numba_dppy #118

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions numba/core/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,24 @@ def __wrapper(func):
f"{type(func)})."
)

from numba import dppl_config
if (target == 'npyufunc' or targetoptions.get('no_cpython_wrapper')
or sigs or config.DISABLE_JIT or not targetoptions.get('nopython')
or dppl_config.dppl_present is not True):
is_numba_dppy_present = False
try:
import numba_dppy.config as dppy_config

is_numba_dppy_present = dppy_config.dppy_present
except ImportError:
pass

if (not is_numba_dppy_present
or target == 'npyufunc' or targetoptions.get('no_cpython_wrapper')
or sigs or config.DISABLE_JIT or not targetoptions.get('nopython')):
target_ = target
if target_ is None:
target_ = 'cpu'
disp = registry.dispatcher_registry[target_]
return wrapper(func, disp)

from numba.dppl.target_dispatcher import TargetDispatcher
from numba_dppy.target_dispatcher import TargetDispatcher
disp = TargetDispatcher(func, wrapper, target, targetoptions.get('parallel'))
return disp

Expand Down