[Fix]Enable abacus to be compiled with CXX 17 & CUDA 13#6777
Merged
[Fix]Enable abacus to be compiled with CXX 17 & CUDA 13#6777
Conversation
mohanchen
approved these changes
Dec 15, 2025
Collaborator
|
Current implementation of if(CUDA_VERSION VERSION_GREATER_EQUAL "13.0")
message(STATUS "CUDA ${CUDA_VERSION} detected. Setting CMAKE_CUDA_STANDARD to 17.")
set_if_higher(CMAKE_CXX_STANDARD 17)
endif()Actually when executing |
8 tasks
12 tasks
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.
Linked Issue
Fix #6752
See also conda-forge/abacus-feedstock#78
Unit Tests and/or Case Tests for my changes
What's changed?
This PR introduces a CUDA compatibility layer to prepare the codebase for CUDA 13 support and centralize version-specific logic. The key changes are:
source/source_base/module_device/cuda_compat.handcuda_compat.cpp. This module acts as an abstraction layer to handle differences between CUDA versions.cufftGetErrorString, which has removed error codes in CUDA 13.clockRate,memoryClockRate, etc) which were removed in CUDA 13 have been moved fromoutput_device.cppinto the new compatibility layer. This cleans up the main application logic and isolates version-specific code.CMakeLists.txtwas updated to include the new source files.The primary impact is that ABACUS can now be built with CUDA 13 without modifying the main application code. This also improves long-term maintainability by creating a dedicated place for future CUDA compatibility fixes.
Any changes of core modules? (ignore if not applicable)
There are no changes to the core solver modules (
ESolver,HSolver,ElecState,Hamilt,Operator, orPsi). The changes are contained within themodule_deviceinfrastructure layer. The purpose of this refactoring is to abstract away hardware/driver-specific details from the core scientific modules, ensuring they remain unaffected by changes in the underlying CUDA toolkit.