Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Exercises/instances/Begin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 1 addition & 9 deletions Exercises/instances/Begin/instances_begin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ using ViewVectorType = Kokkos::View<double*>;
using ViewMatrixType = Kokkos::View<double**>;

// 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 =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure it is worth adding that commented line.

Suggested change
// using ResultMemSpace =

using ResultType = double;

// EXERCISE: We need to pass in an instance
Expand Down
1 change: 0 additions & 1 deletion Exercises/instances/CMakeLists.txt

This file was deleted.

6 changes: 6 additions & 0 deletions Exercises/instances/Solution/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
12 changes: 2 additions & 10 deletions Exercises/instances/Solution/instances_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ using range_policy = Kokkos::RangePolicy<ExecSpace>;
using ViewVectorType = Kokkos::View<double*>;
using ViewMatrixType = Kokkos::View<double**>;

#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<double, RESULT_MEM_SPACE>;
using ResultMemSpace = Kokkos::SharedHostPinnedSpace;
using ResultType = Kokkos::View<double, ResultMemSpace>;

void operation(ExecSpace instance, ResultType result, ViewMatrixType A, ViewVectorType y, ViewVectorType x) {
int N = x.extent(0);
Expand Down
Loading