The
__host__execution space specifier
declares a function that is:
Executed on the
host (= CPU),
Callable
from the host only.
The __host__ specifier is
the default:
If a function has
no execution space specifier,
it is assumed
to be __host__
A __host__ specified functions is
an "ordinary" C function !!!
__global__ specified functions:
The
__global__execution space specifier
declares a function that is:
Executed on the
device (= GPU),
Callable
from the host.
Callable
from the device also (compute capacity 3.2 or higher).
The __global__ specified
functions are
called by C function(s) in the main program
to perform a task
in the GPU
and exploit the GPU's
parallel execution capability
__device__ specified functions:
The
__device__execution space specifier
declares a function that is:
Executed on the
device (= GPU),
Callable
from the device (= GPU)only.
The __device__ specified
functions are
help functions
used by __global__
speficied function