Sarek_cuda.Cuda_ptx_isaPTX ISA versions: which one an SM needs and which one a driver accepts.
Cuda_api.Kernel.load_from_ptx rewrites .target to the device's own SM, so .version must follow: PTX ISA 8.0 does not know sm_120 (issue #506). Pure: no libcuda, no device.
val to_string : t -> stringval of_string : string -> t optionof_string "8.7" is Some (8, 7); None on anything else.
val required_version : major:int -> minor:int -> tThe lowest PTX ISA version that admits .target sm_<major><minor>. sm_88 (also what ZLUDA reports), sm_110 and SMs not listed get 9.0, the newest version here; ZLUDA parses it. Pre-Ampere SMs get 7.0.
val driver_max_version : (int * int) -> t optiondriver_max_version (major, minor) is the highest PTX ISA the driver's CUDA version (from cuDriverGetVersion, e.g. 13.0) accepts, per the PTX ISA release notes. None when the driver is newer than this table (or older than CUDA 11.8): unknown, so not gated here, and the driver's own error stands.
val check_driver :
driver:(int * int) ->
required:t ->
(unit, string) Stdlib.resultcheck_driver ~driver ~required is Error msg naming both versions when the driver is known to accept less than required.
Rewrite .target to sm_<major><minor> and raise .version to at least required_version for that SM. A .version already at or above it, or one that does not parse, is left alone: the version is never lowered.
val declared_version : string -> t optionThe .version the PTX declares, None if absent or unparseable.