NVIDIA/numbast

Error when using functions with unnamed arguments

Open

#168 aperta il 13 ago 2025

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)C (22 fork)github user discovery
good first issue

Metriche repository

Star
 (62 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor