From 2bbce535b8087192489f4ccfce1610226f6e65e9 Mon Sep 17 00:00:00 2001 From: Forrest Glines Date: Sat, 15 Jul 2023 10:07:56 -0600 Subject: [PATCH 1/2] Skip --expt-relaxed-constexpr with nvc++/nvhpc --- src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d80d25d27e5..9384f0fc68a1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,9 +293,11 @@ endif() # However, Parthenon heavily relies on it and there is no harm in compiling Kokkos # without and Parthenon with (via Max Katz on the Kokkos Slack channel). # Therefore, we don't use the Kokkos_ENABLE_CUDA_CONSTEXPR option add the flag manually. -# Also, not checking for NVIDIA as nvcc_wrapper is identified as GNU so we just make sure -# the flag is not added when compiling with Clang for Cuda. -if (Kokkos_ENABLE_CUDA AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +# Also, not checking for NVIDIA as nvcc_wrapper is identified as GNU so we just +# make sure the flag is not added when compiling with Clang for Cuda. The flag +# is also not necessary (and not recognized) when using nvc++ to compile Cuda +# code +if (Kokkos_ENABLE_CUDA AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC") target_compile_options(parthenon PUBLIC --expt-relaxed-constexpr) endif() From 81ba35326011da443299b7cbeac89a75b7acb854 Mon Sep 17 00:00:00 2001 From: Forrest Glines Date: Sat, 15 Jul 2023 10:55:21 -0600 Subject: [PATCH 2/2] Rename restrict to non C-keyword --- example/sparse_advection/sparse_advection_driver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/sparse_advection/sparse_advection_driver.cpp b/example/sparse_advection/sparse_advection_driver.cpp index 9293f34636e6..37e78756477a 100644 --- a/example/sparse_advection/sparse_advection_driver.cpp +++ b/example/sparse_advection/sparse_advection_driver.cpp @@ -122,12 +122,12 @@ TaskCollection SparseAdvectionDriver::MakeTaskCollection(BlockList_t &blocks, mdudt.get(), beta * dt, mc1.get()); // do boundary exchange - auto restrict = + auto restrict_task = parthenon::AddBoundaryExchangeTasks(update, tl, mc1, pmesh->multilevel); // if this is the last stage, check if we can deallocate any sparse variables if (stage == integrator->nstages) { - tl.AddTask(restrict, SparseDealloc, mc1.get()); + tl.AddTask(restrict_task, SparseDealloc, mc1.get()); } }