Closed EmilyBourne closed 6 months ago
I prefer option (2) for a few reasons:
However, we will have to take care to ensure that the prototypes are fully compatible. A wrapper generation stage may still be necessary to translate e.g. between array representations.
@bauom what do you think?
Describe the bug
The main branch imports the header of the generated source file inside a
extern 'C'
block. This works for functions which don't use cuda functionalities, but cuda objects such as kernels cannot be expressed in C so they shouldn't be declared inside anextern 'C'
block.To Reproduce
Provide code to reproduce the behaviour:
Error details
Provide the generated code
Expected behaviour
There are two possible ways of handling this.
1. Treat the generated code as pure Cuda code and add a wrapper. The generated cuda code should then be:
tmp.cu:
tmp.h
but an additional cuda to c wrapper is required.
2. Mark the C-compatible Cuda code in the header. The generated cuda code should then be:
tmp.h
In the C-Python API this .h file shouldn't be imported. Instead (as for Fortran) the declarations should also be printed in the header of the wrapper. I.e.:
Language
Cuda
Additional context
Found by @smazouz42 in #42