Module compute

Module compute 

Source
Expand description

Hardware-agnostic compute target abstraction.

Defines the ComputeTarget trait: the contract that any GPU compilation and runtime target must satisfy (NVIDIA/PTX, AMD/HSACO, Apple/Metal, etc.).

Atlas is designed so that:

  • Build time: kernel source files are compiled by a target-specific compiler into a target-specific binary format (PTX, SPIR-V, metallib).
  • Runtime: the binary modules are loaded via GpuBackend::kernel() and executed via GpuBackend::launch().

This module covers the build-time contract. The runtime contract is defined by GpuBackend in spark-runtime.

§Extending to new hardware

  1. Create a HARDWARE.toml in kernels/<hw>/ with vendor = "<vendor>".
  2. Implement ComputeTarget for the new vendor.
  3. Write kernel source files in the vendor’s language (.cu, .metal, .cl).
  4. Implement GpuBackend in spark-runtime for the vendor’s runtime API.

Structs§

NvidiaTarget
NVIDIA CUDA compilation target: .cu → PTX via nvcc.

Enums§

Vendor
Vendor identifier parsed from HARDWARE.toml.

Traits§

ComputeTarget
Build-time compilation target contract.

Functions§

target_for_vendor
Resolve the appropriate ComputeTarget from a HARDWARE.toml vendor field.