diff --git a/third_party/gauxc/cmake/gauxc-dep-versions.cmake b/third_party/gauxc/cmake/gauxc-dep-versions.cmake index d27e7a0..f5d8d78 100644 --- a/third_party/gauxc/cmake/gauxc-dep-versions.cmake +++ b/third_party/gauxc/cmake/gauxc-dep-versions.cmake @@ -4,6 +4,9 @@ set( GAUXC_LINALG_MODULES_REVISION 9d2c273a671d6811e9fd432f6a4fa3d915b144b8 ) set( GAUXC_CEREAL_REPOSITORY https://github.com/USCiLab/cereal.git ) set( GAUXC_CEREAL_REVISION v1.3.0 ) +set ( GAUXC_NLOHMANN_JSON_REPOSITORY https://github.com/nlohmann/json.git ) +set ( GAUXC_NLOHMANN_JSON_REVISION v3.12.0 ) + set( GAUXC_CUB_REPOSITORY https://github.com/NVIDIA/cub.git ) set( GAUXC_CUB_REVISION 1.10.0 ) @@ -20,4 +23,4 @@ set( GAUXC_INTEGRATORXX_REPOSITORY https://github.com/wavefunction91/IntegratorX set( GAUXC_INTEGRATORXX_REVISION 1369be58d7a3235dac36d75dd964fef058830622 ) set( GAUXC_HIGHFIVE_REPOSITORY https://github.com/BlueBrain/HighFive.git ) -set( GAUXC_HIGHFIVE_REVISION 805f0e13d09b47c4b01d40682621904aa3b31bb8 ) +set( GAUXC_HIGHFIVE_REVISION 805f0e13d09b47c4b01d40682621904aa3b31bb8 ) \ No newline at end of file diff --git a/third_party/gauxc/cmake/gauxc-onedft.cmake b/third_party/gauxc/cmake/gauxc-onedft.cmake index 67fd912..7003d54 100644 --- a/third_party/gauxc/cmake/gauxc-onedft.cmake +++ b/third_party/gauxc/cmake/gauxc-onedft.cmake @@ -1,6 +1,27 @@ -find_package(nlohmann_json REQUIRED) -# store and restore CMAKE_CUDA_ARCHITECTURES if Torch clobbers it +find_package(nlohmann_json) +if( NOT nlohmann_json_FOUND ) + + message( STATUS "Could Not Find nlohmann_json... Building" ) + message( STATUS "NLOHMANN_JSON REPO = ${GAUXC_NLOHMANN_JSON_REPOSITORY}" ) + + FetchContent_Declare( + nlohmann_json + GIT_REPOSITORY ${GAUXC_NLOHMANN_JSON_REPOSITORY} + GIT_TAG ${GAUXC_NLOHMANN_JSON_REVISION} + ) + + FetchContent_GetProperties( nlohmann_json ) + if( NOT nlohmann_json_POPULATED ) + FetchContent_Populate( nlohmann_json ) + endif() + add_library( nlohmann_json::nlohmann_json INTERFACE IMPORTED ) + set_target_properties( nlohmann_json::nlohmann_json PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${nlohmann_json_SOURCE_DIR}/include + ) +endif() + +# store and restore CMAKE_CUDA_ARCHITECTURES if Torch clobbers it set(_PREV_CUDA_ARCHS "${CMAKE_CUDA_ARCHITECTURES}") find_package(Torch REQUIRED) if(CMAKE_CUDA_ARCHITECTURES STREQUAL "OFF") diff --git a/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.cxx b/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.cxx index 9eff757..f776558 100644 --- a/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.cxx +++ b/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.cxx @@ -1,16 +1,21 @@ +#include #include "onedft_util.hpp" +#ifdef GAUXC_HAS_CUDA #include +#endif #include #include -#include +#include namespace GauXC { void print_memory_stats(size_t device_id) { +#ifdef GAUXC_HAS_CUDA size_t free_mem, total_mem; cudaMemGetInfo(&free_mem, &total_mem); // std::cout << "Device ID: " << device_id << std::endl; // std::cout << "Total Memory: " << total_mem / (1024 * 1024) << " MB" << std::endl; // std::cout << "Free Memory: " << free_mem / (1024 * 1024) << " MB" << std::endl; +#endif } bool valueExists(const std::string& value) { for (const auto& pair : feat_map) { diff --git a/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.hpp b/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.hpp index 335bf34..ccd5b2c 100644 --- a/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.hpp +++ b/third_party/gauxc/src/xc_integrator/integrator_util/onedft_util.hpp @@ -1,6 +1,9 @@ +#include #include #include +#ifdef GAUXC_HAS_CUDA #include +#endif #include #include diff --git a/third_party/gauxc/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_onedft.hpp b/third_party/gauxc/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_onedft.hpp index 57652fb..e4e1e0f 100644 --- a/third_party/gauxc/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_onedft.hpp +++ b/third_party/gauxc/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_onedft.hpp @@ -81,7 +81,11 @@ void ReferenceReplicatedXCHostIntegrator:: } // Get Tasks auto& tasks = this->load_balancer_->get_tasks(); +#ifdef GAUXC_HAS_DEVICE auto rt = detail::as_device_runtime(this->load_balancer_->runtime()); +#else + auto rt = this->load_balancer_->runtime(); +#endif int32_t world_rank = rt.comm_rank(); // Temporary electron count to judge integrator accuracy value_type N_EL;