NVIDIA/numbast

Error when using functions with unnamed arguments

Open

#168 opened on Aug 13, 2025

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C (22 forks)github user discovery
good first issue

Repository metrics

Stars
 (62 stars)
PR merge metrics
 (PR metrics pending)

Description

I have this code

struct Foo {
  int x;
  __device__ Foo(int y) : x(y) {}
};

__device__ bool useFoo(Foo) { // note that the parameter is not named
  return true;
}
@cuda.jit
def kernel():
  useFoo(Foo(1))

kernel[1,1]()

This generates the following error:

E   cuda.core.experimental._utils.cuda_utils.NVRTCError: 6: NVRTC_ERROR_COMPILATION, compilation log:
E
E   <unnamed-cu>(11): error: expected an expression
E             retval = useFoo(*);
E                              ^
E
E   1 error detected in the compilation of "<unnamed-cu>".
E

Contributor guide