Skip to content

Error when using functions with unnamed arguments #168

@lakshayg

Description

@lakshayg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions