ptx_arch_runs_on_device

Function ptx_arch_runs_on_device 

Source
pub fn ptx_arch_runs_on_device(
    compiled_arch: &str,
    device_cc: (u32, u32),
) -> Result<(), ArchMismatch>
Expand description

2026-09-25: Can PTX compiled for compiled_arch run on a device of device_cc? Three rules:

  1. plain sm_XY runs on any device with CC >= X.Y;
  2. sm_XYa runs only on CC == X.Y;
  3. sm_XYf runs on the same major version with CC >= X.Y.

A compiled_arch that is not an NVIDIA SM arch (gfx1151, metal3.1) returns Ok(()), so AMD and Apple builds are never refused here. Callers that need to tell the cases apart use parse_sm_arch, whose None is the marker.