Guard OneDFT code with GAUXC_HAS_ONEDFT and remove unused CUDA header#191
Merged
awvwgk merged 2 commits intowavefunction91:skalafrom Apr 1, 2026
Merged
Conversation
Fix build failure when using CPU-only LibTorch with GAUXC_ENABLE_CUDA=ON: onedft_util.hpp included torch/csrc/cuda/CUDAPluggableAllocator.h which transitively requires c10/cuda/impl/cuda_cmake_macros.h — a header only present in CUDA-aware LibTorch distributions. Also fix build when GAUXC_ENABLE_ONEDFT=OFF: onedft_util.cxx was unconditionally compiled, pulling in torch/script.h even when LibTorch is not available. Changes: - Remove unused CUDAPluggableAllocator.h include from onedft_util.hpp (only used by commented-out code in device integrator) - Guard onedft_util.cxx compilation with if(GAUXC_HAS_ONEDFT) in CMake - Guard #include ..._onedft.hpp in host/device integrator .cxx files with #ifdef GAUXC_HAS_ONEDFT - Guard OneDFT method declarations in host integrator header with #ifdef GAUXC_HAS_ONEDFT and provide #else throw stubs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4ad344d to
95ae05d
Compare
awvwgk
approved these changes
Apr 1, 2026
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.
This PR removes the unused
CUDAPluggableAllocator.hinclude fromonedft_util.hpp. It is only used by commented-out code.This also guards
onedft_util.cxxwithif(GAUXC_HAS_ONEDFT)in CMakeLists.#include ..._onedft.hppin host/device integrator.cxxfiles with#ifdef GAUXC_HAS_ONEDFTThis enables using this branch with
GAUXC_HAS_ONEDFT=OFF.