Calling C programs from Fortran global/device code?

Someone may have already the same question, but I cannot find any in this forum.

Please give a simple example.

Thanks in advance.


Hi Takao,

There isn’t a linker for device code, hence there is no way to associate external symbols between objects. Currently, calling external procedures from device code is not possible.

However, CUDA C and CUDA Fortan can share device data provided that a pointer to the device data is passed via the host. For an example of this, please see my PGInsider article Tuning a Monte Carlo Algorithm on GPUs.

Hope this helps,


thanks a lot for quick reply! The article helps a lot, too.