Difference between global and device functions

后端 未结 9 1609
渐次进展
渐次进展 2021-01-29 20:10

Can anyone describe the differences between __global__ and __device__ ?

When should I use __device__, and when to use __glob

9条回答
  •  别那么骄傲
    2021-01-29 20:46

    1. __global__ - Runs on the GPU, called from the CPU or the GPU*. Executed with <<>> arguments.
    2. __device__ - Runs on the GPU, called from the GPU. Can be used with variabiles too.
    3. __host__ - Runs on the CPU, called from the CPU.

    *) __global__ functions can be called from other __global__ functions starting
    compute capability 3.5.

提交回复
热议问题