0PricingLogin
CUDA Academy · Lesson

The __global__ Function Qualifier

Marking a function as a GPU kernel.

Two Worlds, Two Compilers

Your CUDA file holds both CPU and GPU code. A tiny keyword tells the compiler which side a function belongs to. That keyword is the function qualifier. ⚡

Meet __global__

The __global__ qualifier marks a function as a GPU kernel: code the CPU launches but the GPU actually runs across many threads.

__global__ void myKernel() {
    // runs on the GPU
}

All lessons in this course

  1. The __global__ Function Qualifier
  2. __device__ and __host__ Functions
  3. Separate Address Spaces
  4. The Life of a CUDA Program
← Back to CUDA Academy