CUDA Language

Key features:

  • High-level language with references only, in particular removing the complexity of multi-dimensional arrays, memory allocation etc.
  • Produces a "byte-code" format consisting of the runtime CPU code plus PTX code representing the GPU code.
  • A C-based virtual machine which makes use of the JIT compiler for PTX.

What kind of programming features?

  • Clear syntax;
  • Simple structure declaration (later to be extended to true objects);
  • Simple declaration syntax for GPU memory;
  • References instead of pointers;
  • Multi-dimension table declaration and access with:
    • Implicit device <-> host copying as and when required;
    • Direct cell access for higher-dimensional tables, both on the device and the host;
    • A wrapper around cudaPitchedPtr, cudaExtents etc,
  • Simple functions
  • Numeric/bitwise expressions (with operations chosen appropriately by the compiler for maximum efficiency).

Why PTX?

PTX is the ISA of NVIDIA's GPUs.

  • PTX, used in conjunction with the JIT compilation, will support any NVIDIA GPU, thus making an ideal candidate for a low-level representation.

Memory modifiers

  • const - Unchanging on the *device*, and thus stored in constant memory. Can be set on the CPU (but not modified)
  • cached - placed in texture (cached) memory.
Last modified 10 years ago Last modified on Mar 20, 2010, 1:47:22 AM