Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SUNDIALS support to SUNDIALS v7.0.0 #3756

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Src/Extern/SUNDIALS/AMReX_SUNMemory.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "AMReX_Sundials_Core.H"
#include <AMReX.H>
#include <AMReX_Gpu.H>
#include <AMReX_SUNMemory.H>
Expand Down Expand Up @@ -35,7 +36,7 @@ namespace {

int Alloc(SUNMemoryHelper, SUNMemory* memptr, size_t memsize, SUNMemoryType mem_type, void* /*queue*/)
{
SUNMemory mem = SUNMemoryNewEmpty();
SUNMemory mem = SUNMemoryNewEmpty(*The_Sundials_Context());

if (mem == nullptr) { return -1; }
mem->ptr = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Src/Extern/SUNDIALS/AMReX_Sundials_Core.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <AMReX.H>
#include <AMReX_OpenMP.H>
#include <sundials/sundials_context.h>
#include <sundials/sundials_context.hpp>

namespace amrex::sundials {

Expand Down
12 changes: 9 additions & 3 deletions Tools/CMake/AMReXThirdPartyLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,18 @@ endif ()
#
if (AMReX_SUNDIALS)
if (SUNDIALS_FOUND)
message(STATUS "SUNDIALS_FOUND is true, assuming nvecserial or gpu-specific vector found for version 6.0.0 or higher")
message(STATUS "SUNDIALS_FOUND is true, assuming nvecserial or gpu-specific vector found for version 7.0.0 or higher")
else ()
set(SUNDIALS_MINIMUM_VERSION 6.0.0 CACHE INTERNAL "Minimum required SUNDIALS version")
find_package(SUNDIALS ${SUNDIALS_MINIMUM_VERSION} CONFIG QUIET )
set(SUNDIALS_MINIMUM_VERSION 7.0.0 CACHE INTERNAL "Minimum required SUNDIALS version")
set(SUNDIALS_COMPONENTS core arkode cvode sunlinsolspgmr sunlinsolspfgmr
nvecserial nvecmanyvector sunnonlinsolfixedpoint)
find_package(SUNDIALS ${SUNDIALS_MINIMUM_VERSION} CONFIG REQUIRED
COMPONENTS ${SUNDIALS_COMPONENTS})
endif ()
foreach(D IN LISTS AMReX_SPACEDIM)
foreach(comp IN LISTS SUNDIALS_COMPONENTS)
target_link_libraries(amrex_${D}d PUBLIC SUNDIALS::${comp})
endforeach()
if (AMReX_GPU_BACKEND STREQUAL "CUDA")
target_link_libraries(amrex_${D}d PUBLIC SUNDIALS::nveccuda)
elseif (AMReX_GPU_BACKEND STREQUAL "HIP")
Expand Down
Loading