Skip to content

[FEA] Allow passing of NULL pointer in CUDA function #44

@gmarkall

Description

@gmarkall

From numba/numba#9655:

There is currently not a way to pass a NULL pointer to a C function from a compiled python function in CUDA. The value cffi.NULL should be valid in such functions.

For example:

from numba import cuda
import cffi

ffi = cffi.FFI()

func = cuda.declare_device('func', 'int32(CPointer(int32))')

@cuda.jit(link=['/content/func.cu'])
def kernel(values) :
  i_thread = cuda.threadIdx.x

  values[i_thread] = func(ffi.NULL)

cc @ed-o-saurus

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions