Skip to content

Commit

Permalink
Fix D1 color ETI with both CudaSpace and UVM
Browse files Browse the repository at this point in the history
Since GaussSeidel can be instantiated with different
temporary/persistent (aka fast/slow) memory spaces, and calls D1
coloring, D1 coloring itself also needs to be instantiated with
fast/slow spaces.

This fixes undefined reference errors on builds where UVM and CudaSpace
are both instantiated.
  • Loading branch information
brian-kelley committed Jul 18, 2022
1 parent 3e6a759 commit 7813389
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ KOKKOSKERNELS_GENERATE_ETI(Graph_color_d1 color_d1
COMPONENTS graph
HEADER_LIST ETI_HEADERS
SOURCE_LIST SOURCES
TYPE_LISTS FLOATS ORDINALS OFFSETS LAYOUTS DEVICES
TYPE_LISTS FLOATS ORDINALS OFFSETS LAYOUTS DEVICES_W_SLOW_SPACE
)

LIST(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h)
Expand Down
82 changes: 41 additions & 41 deletions src/graph/impl/KokkosGraph_color_d1_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ struct color_d1_eti_spec_avail {
} // namespace Impl
} // namespace KokkosGraph

#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_AVAIL(SCALAR_TYPE, ORDINAL_TYPE, \
OFFSET_TYPE, LAYOUT_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE) \
template <> \
struct color_d1_eti_spec_avail< \
KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_AVAIL( \
SCALAR_TYPE, ORDINAL_TYPE, OFFSET_TYPE, LAYOUT_TYPE, EXEC_SPACE_TYPE, \
MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE) \
template <> \
struct color_d1_eti_spec_avail< \
KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
};

// Include the actual specialization declarations
Expand Down Expand Up @@ -118,34 +118,34 @@ struct COLOR_D1<KernelHandle, size_view_t, lno_view_t, false,
} // namespace Impl
} // namespace KokkosGraph

#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_DECL(SCALAR_TYPE, ORDINAL_TYPE, \
OFFSET_TYPE, LAYOUT_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE) \
extern template struct COLOR_D1< \
typename KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_DECL( \
SCALAR_TYPE, ORDINAL_TYPE, OFFSET_TYPE, LAYOUT_TYPE, EXEC_SPACE_TYPE, \
MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE) \
extern template struct COLOR_D1< \
typename KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
false, true>;

#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_INST(SCALAR_TYPE, ORDINAL_TYPE, \
OFFSET_TYPE, LAYOUT_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE) \
template struct COLOR_D1< \
KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
#define KOKKOSGRAPH_COLOR_D1_ETI_SPEC_INST( \
SCALAR_TYPE, ORDINAL_TYPE, OFFSET_TYPE, LAYOUT_TYPE, EXEC_SPACE_TYPE, \
MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE) \
template struct COLOR_D1< \
KokkosKernels::Experimental::KokkosKernelsHandle< \
const OFFSET_TYPE, const ORDINAL_TYPE, const SCALAR_TYPE, \
EXEC_SPACE_TYPE, MEM_SPACE_TYPE, SLOW_MEM_SPACE_TYPE>, \
Kokkos::View<const OFFSET_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
Kokkos::View<const ORDINAL_TYPE *, LAYOUT_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
false, true>;

#include <generated_specializations_hpp/KokkosGraph_color_d1_eti_spec_decl.hpp>
Expand Down

0 comments on commit 7813389

Please sign in to comment.