What Does __Global__ Mean in the Context of a Function Declaration in C?
I'm Reading a C Program Where a Function Is Declared Like So: __Global__ Void Square(Float *D_Out, Float *D_In); What Does the __Global__ Specifier Mean? 5 1...
I'm reading a C program where a function is declared like so:
__global__ void square(float *d_out, float *d_in);
what does the __global__ specifier mean?
1 Answer
It is not standard C, only some extension or #define.
It looks like CUDA.
__global__ function is executed on GPU, it can be called from CPU or the GPU.
Calling __global__ functions is often more expensive than __device__.
If it is a #define, compile the file with the -E (gcc) or similar option and see how this macro is expanded.