preflight_arch

Function preflight_arch 

Source
pub fn preflight_arch(ptx_set: &TargetPtxSet) -> Option<&'static str>
Expand description

Which architecture string a resolved target’s preflight must judge.

A TargetPtxSet carries two readings of one [hardware].arch declaration, and only one of them can answer this question:

  • target.arch is the BASE SM (sm_90, sm_121) — the identity the registry, KernelTarget’s constants and every gate baseline are keyed by. Its feature suffix has been stripped, so sm_90a arrives as plain sm_90, which the forward-compat rule says runs on any CC >= 9.0.
  • ptx_arch is the declaration VERBATIM (sm_90a, sm_121f) — what nvcc was handed, suffix and all. The suffix IS the compatibility rule.

Passing the base SM here is not a slightly weaker check, it is the wrong one: Hopper-only PTX would pass on a B200 (CC 10.0) or a GB10 (12.1) and then fail inside cuModuleLoadData — the driver error with no useful nouns in it that this whole module exists to pre-empt.

None when the target records no architecture, which the caller warns about and skips rather than treating as a pass.