diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c51453..2d85b99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0) project(FDTD) @@ -15,6 +15,11 @@ include_directories(3rdparty) UNSET(Kokkos_DIR CACHE) set(Kokkos_DIR 3rdparty/kokkos/build/) +set(Kokkos_NVCC_WRAPPER "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/kokkos/bin/nvcc_wrapper") +set(Kokkos_COMPILE_LAUNCHER "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/kokkos/bin/kokkos_launch_compiler") +set(Kokkos_HOST_COMPILER "g++") + + if(NOT DEFINED Kokkos_ENABLE_CONTAINERS) set(Kokkos_ENABLE_CONTAINERS ON) endif() @@ -57,9 +62,8 @@ add_custom_command( add_custom_target(create_kokkoscore ALL DEPENDS ${KOKKOS_CORE_LIB}) - find_package(Kokkos REQUIRED) add_subdirectory(project) add_subdirectory(test) -add_subdirectory(samples) +add_subdirectory(samples) \ No newline at end of file diff --git a/src/FDTD_kokkos/FDTD_kokkos.cpp b/src/FDTD_kokkos/FDTD_kokkos.cpp index af37b66..328fb5a 100644 --- a/src/FDTD_kokkos/FDTD_kokkos.cpp +++ b/src/FDTD_kokkos/FDTD_kokkos.cpp @@ -170,7 +170,7 @@ void FDTD::update_fields(bool write_result, Axis write_axis, std::string base_pa Kokkos::deep_copy(By_host, By); Kokkos::deep_copy(Bz_host, Bz); - std::vector return_data{ Ex_host, Ey_host, Ez_host, Bx_host, By_host, Bz_host }; + std::vector return_data{ Ex, Ey, Ez, Bx, By, Bz }; if (write_result) write_spherical(return_data, write_axis, base_path, t); } @@ -301,7 +301,7 @@ void FDTD::update_fields(bool write_result, Axis write_axis, std::string base_pa Kokkos::deep_copy(By_host, By); Kokkos::deep_copy(Bz_host, Bz); - std::vector return_data{ Ex_host, Ey_host, Ez_host, Bx_host, By_host, Bz_host }; + std::vector return_data{ Ex, Ey, Ez, Bx, By, Bz }; if (write_result) write_spherical(return_data, write_axis, base_path, t); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f174f44..5ed3b15 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -13,8 +13,8 @@ add_subdirectory(../3rdparty/googletest ../3rdparty/googletest/build EXCLUDE_FRO add_executable(${target} ${srcs} ${hdrs}) add_dependencies(${target} gtest) target_link_directories(${target} PUBLIC ${CMAKE_BINARY_DIR}/googletest/lib) -target_link_libraries(${target} PUBLIC gtest gtest_main) +target_link_libraries(${target} PRIVATE gtest gtest_main) -target_link_libraries(${target} Kokkos::kokkos) +target_link_libraries(${target} PRIVATE Kokkos::kokkos) add_compile_options(/wd4996)