Commit Graph

17 Commits

Author SHA1 Message Date
Eli Schwartz 65ee397f34
cuda module: fully type annotate
Special notes:
- _nvcc_arch_flags is always called with exact arguments, no need for
  default values
- min_driver_version has its args annotation loosened because it has to
  fit the constraints of the module interface?
2024-02-12 23:51:35 -05:00
Eli Schwartz 5899daf25b
cuda module: use typed_pos_args for most methods
The min_driver_version function has an extensive, informative custom
error message, so leave that in place.

The other two functions didn't have much information there, and it's
fairly evident that the cuda compiler itself is the best thing to have
here. Moreover, there was some fairly gnarly code to validate the
allowed values, which we can greatly simplify by uplifting the
typechecking parts to the dedicated decorators that are both really good
at it, and have nicely formatted error messages complete with reference
to the problematic functions.
2024-02-12 23:35:39 -05:00
Eli Schwartz 1b15176168
cuda module: inline single-shot function to get compiler version
It is pretty trivial and more confusing when standalone, especially the
use of a sentinel "unknown" string as a standin for "this isn't one of
the allowed object types". Much easier to directly raise an error in the
fallthrough/else.
2024-02-12 23:13:59 -05:00
Eli Schwartz 8ff25c0bca
cuda module: fix type signature for oneshot function
It is only ever invoked once. It has a statically known signature based
on how it's used, so there's no good reason to allow it to accept any
defaults -- and defaulting to None messes with type safety.

Saturate is always given, so don't claim it is only sometimes.
2024-02-12 23:13:59 -05:00
Eli Schwartz cf35d9b4ce
cuda module: use typed_kwargs
This officially only ever accepted string or array of strings.
2024-02-12 23:12:10 -05:00
Dylan Baker 6ccd708f30 modules: get rid of the .*machine variables
They're hardly used, and can be gotten directly from the Environment
instead
2023-12-22 11:31:48 -08:00
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
David Seifert 5feeb1c2ef CUDA: make "Ampere" equivalent to SM8.0+SM8.6 2023-03-19 08:31:28 -04:00
Eli Schwartz c9ac73a4da
simplify instantiation of builtin type using builtins instead of functions 2023-02-01 17:01:30 -05:00
Olexa Bilaniuk 255f335d8e CUDA: Update compute-capability limits logic for CUDA 12.
In particular, CUDA 12 removes support for Kepler (3.x) entirely.
Unusually, however, it does not introduce any new architectures,
or even compute capabilities.
2022-12-11 00:11:43 +02:00
Olexa Bilaniuk 36751d5d4c CUDA: Add listing for newly-released CUDA 12 in minimum driver version table. 2022-12-11 00:11:43 +02:00
Olexa Bilaniuk 6190b6466e CUDA: Update minimum driver version table to include CUDA 11.8
Agrees with Release Notes, Section 1.1, Table 3.
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
2022-11-29 18:44:40 -05:00
Olexa Bilaniuk 5b5798310a CUDA: Bugfix to architectural limit checks.
The upper bound on the CUDA Compute Capability is not always known.
Avoid checking cuda_hi_limit_gpu_architecture if it remains undefined.
2022-11-29 18:44:40 -05:00
Olexa Bilaniuk c4f3589215 CUDA: Add Orin, Lovelace and Hopper architecture names for CUDA 11.8
Co-authored-by: David Seifert <soap@gentoo.org>
2022-11-29 18:44:40 -05:00
Eli Schwartz 5bfab845d0
compilers: directly import from subpackages
It turns out we don't generally need to proxy every compiler ever
through the top-level package. The number of times we directly poke at
one is negligible and direct imports are pretty clean.
2022-09-19 15:19:00 -04:00
Alf Henrik Sauge 06bf9a5cda Fix purely white space issues reported by flake8 2022-08-26 17:12:40 -04:00
Dylan Baker a78992dd81 interpreter: move handling of module stability to interpreter
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of
`unstable_foo.py`, which simplifies the import method a bit. This also
allows for accurate FeatureNew/FeatureDeprecated use, as we know when
the module was added and if/when it was stabilized.
2022-08-17 16:25:36 -04:00