Skip to content

Commit

Permalink
add missing ifdef (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpintarelli authored Jun 17, 2024
1 parent 3b64a5a commit e7ea662
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
9 changes: 3 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ target_link_libraries(test_stride_dvector PRIVATE nlcglib_core)
add_executable(test_mpi_wrapper test_mpi_wrapper.cpp)
target_link_libraries(test_mpi_wrapper PRIVATE nlcglib_core)

add_executable(test_solver test_solver.cpp)
target_link_libraries(test_solver PRIVATE nlcglib_core)

add_executable(test_mvector_cuda test_mvector_cuda.cpp)
target_link_libraries(test_mvector_cuda PRIVATE nlcglib_core)

Expand All @@ -28,9 +25,6 @@ target_link_libraries(test_deep_copy PRIVATE nlcglib_core)
add_executable(test_smearing test_smearing.cpp)
target_link_libraries(test_smearing PRIVATE nlcglib_core)

# add_executable(test_check_alignment test_check_alignment.cpp)
# target_link_libraries(test_check_alignment PRIVATE nlcglib_core)

add_executable(test_buffer test_buffer.cpp)
target_link_libraries(test_buffer PRIVATE nlcglib_core)

Expand All @@ -43,6 +37,9 @@ target_link_libraries(test_lambda_device PRIVATE nlcglib_core)

add_executable(test_gpu test_gpu.cpp)
target_link_libraries(test_gpu PRIVATE nlcglib_core)

add_executable(test_solver test_solver.cpp)
target_link_libraries(test_solver PRIVATE nlcglib_core)
endif()

add_executable(test_utils test_utils.cpp)
Expand Down
8 changes: 3 additions & 5 deletions test/test_kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ kokkos_reduction_device()
#elif defined __NLCGLIB__ROCM
using space = Kokkos::Experimental::HIPSpace;
using exec_space = Kokkos::Experimental::HIP;
#else
using space = Kokkos::HostSpace;
using exec_space = Kokkos::Serial;
#endif

int n = 100;
Expand All @@ -115,11 +118,6 @@ kokkos_reduction_device()
}


struct fun
{
__device__ __host__ double operator()(double x) const { return 1 / (1 + exp(x)); }
};

int
main(int argc, char* argv[])
{
Expand Down
1 change: 0 additions & 1 deletion test/test_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ run_unmanaged()
}
}


int
main(int argc, char *argv[])
{
Expand Down
5 changes: 5 additions & 0 deletions unit_tests/local/test_solver_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ TestSymSolve<T>::SetUp()
matrix_t H(Map<>(Communicator(), SlabLayoutV({{0, 0, ncols, ncols}})));
}

#if (!__NLCGLIB__CUDA) && (!__NLCGLIB__ROCM)
// pass
#else
// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#typed-tests
#ifdef __NLCGLIB__CUDA
using KokkosMemTypes = ::testing::Types<Kokkos::CudaSpace, Kokkos::HostSpace>;
Expand Down Expand Up @@ -90,3 +93,5 @@ TYPED_TEST(TestSymSolve, PotrfPotrs)
}
}
}

#endif

0 comments on commit e7ea662

Please sign in to comment.