Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds basic support for CUDA 13. As before, no new functionality was added; all I did was make the existing functionality work as well as possible with the new APIs. A few CUDA functions have gained additional parameters; these are not exposed in Haskell and simply filled with whatever makes the functions do what they previously did.
The most controversial part of this PR is that a few fields have been removed from
cudaDeviceProps; here follows.Device properties
The current design in these Haskell bindings is to have a single
DevicePropertiesdata type shared between the driver API and the runtime API, and this data type is bound (via a dubious Storable instance that defines onlypeek, notpoke, as not all C fields are reflected in Haskell) to what is available incudaDeviceProps— a data type in the runtime API. This makes the implementation of the runtime API natural; the driver API is then written by querying all the necessary values usingcuDeviceGetAttribute.What is awkward about this design is that
cudaDevicePropsdoes not contain all interesting properties about a device, so if a user is using the driver API, thisDevicePropertiesrecord is nothing more than a strange subset of all actual device properties: many that you likely won't need, and skipping some that you do need. This situation is exacerbated when NVIDIA decides that a bunch of fields are now (cuda 13) removed from cudaDeviceProps, meaning that if the current Haskell bindings design is retained, these fields also disappear fromDeviceProperties, and users who were using them now have to manually query device attributes to get them.This PR opts to keep the design the same and do the above, hence breaking clients. (I don't think there's a solution to this situation that incurs no breakage at all.) For
accelerate-llvm-ptx, it turns out that only 1 dropped property was actually used (clockRate); the resulting patch, which compiles and tests successfully with this PR, is tomsmeding/accelerate-llvm@5eb8838.@tmcdonell What do you think?