Skip to content

Guard OneDFT code with GAUXC_HAS_ONEDFT and remove unused CUDA header#191

Merged
awvwgk merged 2 commits intowavefunction91:skalafrom
tvogels:fix/onedft-build-guards
Apr 1, 2026
Merged

Guard OneDFT code with GAUXC_HAS_ONEDFT and remove unused CUDA header#191
awvwgk merged 2 commits intowavefunction91:skalafrom
tvogels:fix/onedft-build-guards

Conversation

@tvogels
Copy link
Copy Markdown

@tvogels tvogels commented Mar 31, 2026

This PR removes the unused CUDAPluggableAllocator.h include from onedft_util.hpp. It is only used by commented-out code.

This also guards

  • the compilation of onedft_util.cxx with if(GAUXC_HAS_ONEDFT) in CMakeLists.
  • #include ..._onedft.hpp in host/device integrator .cxx files with #ifdef GAUXC_HAS_ONEDFT

This enables using this branch withGAUXC_HAS_ONEDFT=OFF.

@tvogels tvogels marked this pull request as ready for review March 31, 2026 19:41
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>
@tvogels tvogels force-pushed the fix/onedft-build-guards branch from 4ad344d to 95ae05d Compare March 31, 2026 19:46
@awvwgk awvwgk merged commit 15df359 into wavefunction91:skala Apr 1, 2026
@awvwgk awvwgk added the Skala Related to the Skala exchange-correlation functional label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skala Related to the Skala exchange-correlation functional

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants