Skip to content

Support for Calling Device Functions from numba.jit functions #205

Closed
@PokhodenkoSA

Description

@PokhodenkoSA

DPPY device functions can not be called from @numba.jit functions.

Example:
Example:

@dppy.func
def a_device_function(a):
    return a + 1

@numba.jit(nopython=True)
def a_numba_function(x):
    return a_device_function(x)

def test_device_function():
    context = get_context()
    with dpctl.device_context(context):
        C = a_numba_function(10)

    print(C)

Output:

numba.core.errors.TypingError: Failed in dppy_nopython mode pipeline (step: nopython frontend)
Untyped global name 'a_device_function': cannot determine Numba type of <class 'numba_dppy.compiler.DPPYFunctionTemplate'>

File "numba_dppy/examples/dppy_func.py", line 13:
def a_numba_function(x):
    return a_device_function(x)
    ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions