CUDA Fortran kernel invoke a CUDA C kernel

Is it possible to invoke a CUDA C kernel (compiled in a shared library) from a CUDA Fortran kernel, e.g. CUDA C is inline function.

If possible, could someone post here an example to do so.

Thanks,

Tuan

Hi Tuan,

Unfortunately no. CUDA Fortran “global” and “device” routines are only able to call other “device” routines located in the same Module. The reason for this is that all calls made from a kernel must be inlined at compile time.

We are investigating ways in which we can remove this restriction. Though given the difficultly, it may not be solved for some time.

Thanks,
Mat

Thanks Mat. CUDA C doesn’t have such restriction, i.e. inline kernel can only be invoked from a global kernel form the same file, right?

Tuan

Hi Tuan,

CUDA C has a similar restriction. All calls to device subroutines must be within the same file scope as the caller. Though programmers can use the “#include” pragma to include routines from other files. Like CUDA Fortran, all device routines are inlined at compile time.

  • Mat