Revision history for Perl extension CUDA-DriverAPI

v0.0.1 2026-12-05T03:18:49Z

    - First release to CPAN
    - Use semantic versions in dotted form, starting at v0.0.1 (a prototype:
      the API may still change before v1.0.0)
    - Require Perl 5.40 and CUDA 12.0 or later, including NVRTC
    - Object API: CUDA::DriverAPI->device returns a CUDA::DriverAPI::Device
      (the device's primary context), which allocates
      CUDA::DriverAPI::Buffer objects and loads CUDA::DriverAPI::Program
      objects, whose CUDA::DriverAPI::Kernel objects launch kernels. This
      replaces new(), run($code, $name, ...), malloc/free and transfer_*
    - Kernel->launch(grid =>, block =>, shared =>, args =>) and
      Kernel->configure(...), which returns a reusable launcher
    - Kernel arguments are buffers, [type => value] pairs or, for a kernel
      looked up with signature => [...], plain values; a plain number
      without a type croaks instead of being passed as a pointer. Types:
      i8..u64, f32, f64, ptr, and bytes for packed structs
    - With drivers for CUDA 12.4 or later, the number and size of the
      arguments (and a signature) are checked against the kernel before the
      launch
    - Driver and NVRTC errors die with CUDA::DriverAPI::Error objects
      (kind, call, code, name, description, compiler log), reported at the
      caller's line
    - Device: name, compute_capability, total_memory, memory_info,
      synchronize, destroy; CUDA::DriverAPI->device_count, driver_version,
      nvrtc_version
    - Device->compile builds CUDA C++ source with NVRTC for the device's own
      architecture and finds the toolkit headers (cuda_fp16.h,
      cuda/std/...) without options; load and load_file take cubin, fatbin
      or PTX
    - Buffers are freed automatically; write/read with offsets, fill
      (cuMemsetD8Async), slice for views, Device->wrap_buffer for memory
      allocated elsewhere, and empty buffers
    - Buffer->write_array/read_array convert nested arrays in C, and take and
      return PDL ndarrays (optional dependency) without conversion
    - Launches and fill are asynchronous on the legacy default stream; reads
      wait for them
    - Streams and events: Device->stream (priority, non_blocking),
      Device->event (timing), Stream->synchronize/is_done/record/wait_for,
      Event->record/synchronize/is_done/elapsed_since; a stream option on
      launches, configure, fill, reads and writes; Device->with_stream sets
      the current stream for a block of code
    - Device->host_buffer allocates page-locked host memory
      (CUDA::DriverAPI::HostBuffer) for asynchronous Buffer->copy_from and
      copy_to, which also copy between device buffers
    - Device->attribute, uuid, pci_bus_id and limit; attribute and limit
      names in CUDA::DriverAPI::Constants, generated from cuda.h
    - Program->global for __device__/__constant__ variables;
      compile(name_expressions => [...]) for template kernels, with
      Program->lowered_names and load(lowered_names => ...) for cached images
    - Kernel->attribute/set_attribute, max_dynamic_shared (more than 48 KB of
      dynamic shared memory), max_active_blocks and suggested_block_size
      (occupancy), and cooperative launches
    - Buffer->fill(value, type => ...) fills 2- and 4-byte elements
    - Stream->capture records kernel launches, fills and copies into a
      CUDA::DriverAPI::Graph, replayed with Graph->launch; the graph keeps
      the objects it uses alive
    - Device->link_code links relocatable device code (CUDA sources compiled
      with -rdc, PTX, cubin, fatbin, objects, libraries) with cuLink*
    - Device->managed_buffer allocates managed (unified) memory
    - Host buffers wait for the copies queued from or to them before host
      access
    - Kernel->suggested_block_size returns (min_grid, block) in list context,
      in CUDA's order
    - Integer kernel arguments and typed fill values must be integers (of the
      right sign; up to 32 bits also in range) instead of being wrapped or
      truncated silently
    - Frees requested during a capture run once it has ended; a free the
      driver rejects stays recorded, and destroy retries it
    - Argument errors detected in C name the caller's file and line
    - Bounds-check every transfer against the buffer
    - Objects are not cloned into ithreads (CLONE_SKIP) and do nothing in a
      forked child: methods croak, and nothing is released through the
      parent's context
    - destroy releases everything even when a step fails
    - CUDA_ERROR_UNSUPPORTED_PTX_VERSION explains that the toolkit is newer
      than the driver
    - read_array croaks on dims such as [1e9, 0], which allocated a billion
      empty rows (empty arrays may have as many rows as the buffer has bytes,
      or 65536)
    - Load libcuda at run time, so the module builds and loads without an
      NVIDIA driver; device() then explains what is missing
    - Resolve every driver entry point at its CUDA 12.0 ABI (with CUDA 13
      headers, cuCtxSynchronize was called through the 13.0 variant that
      takes a context)
    - Find the CUDA Toolkit without configuration (nvcc on PATH,
      /usr/local/cuda, /usr/local/cuda-X.Y, /opt/cuda, $CONDA_PREFIX, /usr);
      CUDA_HOME/CUDA_PATH pick a specific one. Without a toolkit, Build.PL
      stops with "OS unsupported"
    - compile() works with a toolkit outside the ld.so.conf paths (NVRTC finds
      libnvrtc-builtins through the module's DT_RPATH, which also takes
      precedence over LD_LIBRARY_PATH)
    - Tests use Test2::V0 and skip when no CUDA device is available
    - Add Perl::Critic author test
    - Replace Travis CI with GitHub Actions

0.01 2013-11-22 (not released to CPAN)

    - original version

