Skip to content

Gaps in Writing Device Functions #152

Closed
@PokhodenkoSA

Description

@PokhodenkoSA

Study the Writing Device Functions section and document the equivalent feature in numba-dppy.

Features:

  1. Device function
@cuda.jit(device=True)
def a_device_function(a, b):
...

numba-dppy provides dppy.func:

@dppy.func
def bar(a):
    return a*a

@dppy.kernel
def foo(in, out):
    i = dppy.get_global_id(0)
    out[i] = bar(in[i])

Similar:

  • invoked from within the device (by a kernel or another device function)
  • return a value (kernels can not return values)

Questions about differences:

  • dppy.func cannot be invoked from the host. cuda.jit(device=True) too?
  • Decorator supports type specialization as a kernel. cuda?
  • Implementation details?
  • dppy.func is inlined into the OpenCL Program containing the @dppy.kernel function calling it. SYCL implementation the same as OpenCL ?
  • Examples from numba.cuda for it?

Examples:

Missing features:

Metadata

Metadata

Assignees

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