diff --git a/Exercises/instances/Begin/CMakeLists.txt b/Exercises/instances/Begin/CMakeLists.txt new file mode 100644 index 00000000..9e64f321 --- /dev/null +++ b/Exercises/instances/Begin/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.22) +project(KokkosTutorialExecInstances) +include(../../common.cmake) + +add_executable(instances instances_begin.cpp) +target_link_libraries(instances Kokkos::kokkos) diff --git a/Exercises/instances/Begin/instances_begin.cpp b/Exercises/instances/Begin/instances_begin.cpp index 1510ef1c..0c80e735 100644 --- a/Exercises/instances/Begin/instances_begin.cpp +++ b/Exercises/instances/Begin/instances_begin.cpp @@ -27,15 +27,7 @@ using ViewVectorType = Kokkos::View; using ViewMatrixType = Kokkos::View; // EXERCISE: We need later a new result type for reductions. What is it? -//#ifdef KOKKOS_ENABLE_CUDA -//#define RESULT_MEM_SPACE Kokkos::CudaHostPinnedSpace -//#endif -//#ifdef KOKKOS_ENABLE_HIP -//#define RESULT_MEM_SPACE Kokkos::HIPHostPinnedSpace -//#endif -//#ifndef RESULT_MEM_SPACE -//#define RESULT_MEM_SPACE Kokkos::HostSpace -//#endif +// using ResultMemSpace = using ResultType = double; // EXERCISE: We need to pass in an instance diff --git a/Exercises/instances/CMakeLists.txt b/Exercises/instances/CMakeLists.txt deleted file mode 100644 index f02f488e..00000000 --- a/Exercises/instances/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -#Todo: Add CMake build diff --git a/Exercises/instances/Solution/CMakeLists.txt b/Exercises/instances/Solution/CMakeLists.txt new file mode 100644 index 00000000..5c853cd1 --- /dev/null +++ b/Exercises/instances/Solution/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.22) +project(KokkosTutorialExecInstances) +include(../../common.cmake) + +add_executable(instances instances_solution.cpp) +target_link_libraries(instances Kokkos::kokkos) diff --git a/Exercises/instances/Solution/instances_solution.cpp b/Exercises/instances/Solution/instances_solution.cpp index b6111043..f022f128 100644 --- a/Exercises/instances/Solution/instances_solution.cpp +++ b/Exercises/instances/Solution/instances_solution.cpp @@ -26,16 +26,8 @@ using range_policy = Kokkos::RangePolicy; using ViewVectorType = Kokkos::View; using ViewMatrixType = Kokkos::View; -#ifdef KOKKOS_ENABLE_CUDA -#define RESULT_MEM_SPACE Kokkos::CudaHostPinnedSpace -#endif -#ifdef KOKKOS_ENABLE_HIP -#define RESULT_MEM_SPACE Kokkos::HIPHostPinnedSpace -#endif -#ifndef RESULT_MEM_SPACE -#define RESULT_MEM_SPACE Kokkos::HostSpace -#endif -using ResultType = Kokkos::View; +using ResultMemSpace = Kokkos::SharedHostPinnedSpace; +using ResultType = Kokkos::View; void operation(ExecSpace instance, ResultType result, ViewMatrixType A, ViewVectorType y, ViewVectorType x) { int N = x.extent(0);