liveBook · Manning

Pointer

As explained in GPU Programming with Triton

A pointer is a variable that stores a memory address used to locate data in memory.

In a Triton kernel, a pointer identifies where tensor data begins in GPU memory; it is an address, not the tensor itself. Triton converts a PyTorch tensor to a pointer when passing it to the kernel. Loads and stores combine that base address with computed offsets to reach individual elements. section 2.2.2

def add_kernel(
    x_ptr, y_ptr, z_ptr,
    n_elements,
    BLOCK_SIZE: tl.constexpr,
):

The kernel signature names three pointers for its input and output data. section 2.2.2

How GPU Programming with Triton covers it

How deep it goes
Defines pointers and explains tensor conversion and offset-based access, without detailing lower-level address representation.
Examples
Shows x_ptr, y_ptr, and z_ptr as kernel parameters for input and output data.
What you can do after
Apply via Triton by passing tensors to a kernel and using pointer bases with offsets for memory access.
How it connects
Connects pointers to Triton kernels, PyTorch tensors, GPU memory, and load and store operations.

Also explained in

Compare how 4 books explain pointer →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GPU Programming with Triton. The section links point to the parts of the book it draws on.