cudss: support 0.8.0+ API (offsetType + cudssDataType_t)#397
Merged
Conversation
cuDSS 0.8.0 made two breaking changes to the matrix-creation API:
- `cudssMatrixCreateCsr` gained a new `offsetType` parameter
immediately before `indexType`, so the call now takes 14 args
instead of 13.
- All matrix-creation functions take `cudssDataType_t` instead of
`cudaDataType_t`, so `CUDA_R_64F`/`CUDA_R_32I`/... must be replaced
with `CUDSS_R_64F`/`CUDSS_R_32I`/...
Guarded on `CUDSS_VER_MAJOR`/`CUDSS_VER_MINOR` so the same source still
compiles against older cuDSS (<=0.7.x).
The `Build and Test cudss` and `GPU` CI jobs started failing on master
when the runner image picked up cuDSS 0.8.x; this restores them.
cudss.h defines CUDSS_VERSION_MAJOR / _MINOR / _PATCH and the composite CUDSS_VERSION = MAJOR*10000 + MINOR*100 + PATCH. The earlier guard used CUDSS_VER_MAJOR, which doesn't exist, so SCS_CUDSS_NEW_API was always 0 and the old call site still failed to compile against cuDSS 0.8.x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The `Build and Test cudss` and `GPU` CI jobs started failing on master once the runner image picked up cuDSS 0.8.x. The new release made two breaking changes to the matrix-creation API:
(Migration notes: https://docs.nvidia.com/cuda/cudss/migration_guide.html)
This PR wraps both changes in a `#if SCS_CUDSS_NEW_API` guard driven by `CUDSS_VER_MAJOR` / `CUDSS_VER_MINOR` (both defined in `cudss.h`), so the same source still builds against older cuDSS (≤ 0.7.x).
`SCS_CUDA_FLOAT` / `SCS_CUDA_INDEX` already abstracted the type tokens — they now resolve to the right enum based on the detected cuDSS version. The CSR create call is the one place that needs a structurally different argument list, so that is the only call site with a `#if/#else`. The Dn calls only take one data-type arg in both APIs, so the existing macro substitution suffices.
Test plan