From d251954e06c006aeb1347c462783ae351bc04bd0 Mon Sep 17 00:00:00 2001 From: Phil Miller Date: Wed, 3 May 2023 13:40:08 -0600 Subject: [PATCH] Work around nvcc issue for view_mapping and add FIXME_NVCC comment --- core/unit_test/TestViewMapping_a.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/unit_test/TestViewMapping_a.hpp b/core/unit_test/TestViewMapping_a.hpp index 9173f0d431..dc576577c2 100644 --- a/core/unit_test/TestViewMapping_a.hpp +++ b/core/unit_test/TestViewMapping_a.hpp @@ -1038,16 +1038,16 @@ void test_view_mapping() { ASSERT_EQ(a.use_count(), 1); ASSERT_EQ(b.use_count(), 0); -#if !defined(KOKKOS_ENABLE_CUDA) || !defined(KOKKOS_ENABLE_CUDA_LAMBDA) - // Cannot launch host lambda when CUDA lambda is enabled. - using host_exec_space = typename Kokkos::Impl::HostMirror::Space::execution_space; int errors = 0; Kokkos::parallel_reduce( Kokkos::RangePolicy(0, 10), - KOKKOS_LAMBDA(int, int& e) { + // FIXME_NVCC: Cannot launch __host__ __device__ lambda on + // host when CUDA lambda is enabled, so use plain [=] instead + // of KOKKOS_LAMBDA + [=](int, int& e) { // an unmanaged copy. When the parallel dispatch accepts a move for // the lambda, this count should become 1. @@ -1058,7 +1058,6 @@ void test_view_mapping() { }, errors); ASSERT_EQ(errors, 0); -#endif // #if !defined( KOKKOS_ENABLE_CUDA_LAMBDA ) } }