Skip to content

Commit

Permalink
This commit completes the multi-level memory system ETI and compilation.
Browse files Browse the repository at this point in the history
On KNLs, to enable explicit HBM and DDR management: run generate makefile with:
--with-memkind=/home/projects/x86-64-knl/memkind/20160811/gcc/4.8.3/

This will add HBWSpace to kokkos devices, and ETI'ed functions will instantiate
for both HostSpace and HBWSpace. I updated these for all blas and sparse functions,
because HBWSpace becomes the default memory space when memkind is enabled, and
instantiating HBWSpace becomes necessity.

For GPUs, if you set KOKKOS_DEVICES=CudaHostPinnedSpace,...
This will generate ETI functions for this memory space as well.
This is only added to sparse functions. This is an optional space,
and "NOT Necessary" to instantiate for blas kernels. I did not add
them for this reason.
  • Loading branch information
mndevec authored and kyungjoo-kim committed Dec 11, 2017
1 parent fedd0e5 commit 025d71d
Show file tree
Hide file tree
Showing 173 changed files with 12,807 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Makefile.kokkos-kernels
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HOSTSPACE=$(strip $(shell echo $(KOKKOSKERN
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_HBWSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "HBWSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "CudaSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "CudaUVMSpace" | wc -l))
KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAHOSTPINNEDSPACE=$(strip $(shell echo $(KOKKOSKERNELS_SPACES) | grep "CudaHostPinnedSpace" | wc -l))

tmp := $(shell echo "" >> KokkosKernels_config.tmp)
tmp := $(shell echo "/* ---------------------------------------------" >> KokkosKernels_config.tmp)
Expand All @@ -207,6 +208,10 @@ endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDAUVMSPACE" >> KokkosKernels_config.tmp )
endif
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAHOSTPINNEDSPACE), 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE" >> KokkosKernels_config.tmp )
endif

ifeq ($(KOKKOSKERNELS_INTERNAL_INST_EXECSPACE_CUDA), 1)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDASPACE), 0)
ifeq ($(KOKKOSKERNELS_INTERNAL_INST_MEMSPACE_CUDAUVMSPACE), 0)
Expand Down
3 changes: 1 addition & 2 deletions perf_test/sparse/KokkosSparse_spgemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,7 @@ int main (int argc, char ** argv){
Kokkos::Cuda::initialize( Kokkos::Cuda::SelectDevice( 0 ) );
Kokkos::Cuda::print_configuration(std::cout);

#ifdef KOKKOSKERNELS_MULTI_MEM

#ifdef KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE
KokkosKernels::Experiment::run_multi_mem_spgemm
<SIZE_TYPE, INDEX_TYPE, SCALAR_TYPE, Kokkos::Cuda, Kokkos::Cuda::memory_space, Kokkos::CudaHostPinnedSpace>(
params
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_specialization_function_sparse_ml.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OrdinalList="int int64_t"
OffsetList="int size_t"
ScalarList="double float Kokkos::complex<double> Kokkos::complex<float>"
LayoutList="LayoutLeft LayoutRight"
ExecMemSpaceList="Cuda,CudaSpace,CudaSpace Cuda,CudaUVMSpace,CudaUVMSpace OpenMP,HostSpace,HostSpace Threads,HostSpace,HostSpace Serial,HostSpace,HostSpace OpenMP,Experimental::HBWSpace,Experimental::HBWSpace Threads,Experimental::HBWSpace,Experimental::HBWSpace Serial,Experimental::HBWSpace,Experimental::HBWSpace Cuda,CudaSpace,CudaHostPinnedSpace Cuda,CudaUVMSpace,CudaUVMSpace OpenMP,Experimental::HBWSpace,HostSpace Threads,Experimental::HBWSpace,HostSpace Serial,Experimental::HBWSpace,HostSpace"
ExecMemSpaceList="Cuda,CudaSpace,CudaSpace Cuda,CudaUVMSpace,CudaUVMSpace OpenMP,HostSpace,HostSpace Threads,HostSpace,HostSpace Serial,HostSpace,HostSpace OpenMP,Experimental::HBWSpace,Experimental::HBWSpace Threads,Experimental::HBWSpace,Experimental::HBWSpace Serial,Experimental::HBWSpace,Experimental::HBWSpace Cuda,CudaSpace,CudaHostPinnedSpace Cuda,CudaHostPinnedSpace,CudaHostPinnedSpace Cuda,CudaUVMSpace,CudaUVMSpace OpenMP,Experimental::HBWSpace,HostSpace Threads,Experimental::HBWSpace,HostSpace Serial,Experimental::HBWSpace,HostSpace"

mkdir generated_specializations_hpp
mkdir generated_specializations_cpp/${Function}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/


#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosSparse_gauss_seidel_spec.hpp"

namespace KokkosSparse {
namespace Impl {
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTLEFT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_CUDA) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_ORDINAL_INT64_T) \
&& defined (KOKKOSKERNELS_INST_OFFSET_INT)
KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_INST(Kokkos::complex<double>, int64_t, int, Kokkos::LayoutLeft, Kokkos::Cuda, Kokkos::CudaHostPinnedSpace, Kokkos::CudaHostPinnedSpace)
#endif
} // Impl
} // KokkosSparse
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/


#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosSparse_gauss_seidel_spec.hpp"

namespace KokkosSparse {
namespace Impl {
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTRIGHT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_CUDA) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_ORDINAL_INT64_T) \
&& defined (KOKKOSKERNELS_INST_OFFSET_INT)
KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_INST(Kokkos::complex<double>, int64_t, int, Kokkos::LayoutRight, Kokkos::Cuda, Kokkos::CudaHostPinnedSpace, Kokkos::CudaHostPinnedSpace)
#endif
} // Impl
} // KokkosSparse
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/


#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosSparse_gauss_seidel_spec.hpp"

namespace KokkosSparse {
namespace Impl {
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTLEFT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_CUDA) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_ORDINAL_INT) \
&& defined (KOKKOSKERNELS_INST_OFFSET_INT)
KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_INST(Kokkos::complex<double>, int, int, Kokkos::LayoutLeft, Kokkos::Cuda, Kokkos::CudaHostPinnedSpace, Kokkos::CudaHostPinnedSpace)
#endif
} // Impl
} // KokkosSparse
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/


#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosSparse_gauss_seidel_spec.hpp"

namespace KokkosSparse {
namespace Impl {
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTRIGHT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_CUDA) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_ORDINAL_INT) \
&& defined (KOKKOSKERNELS_INST_OFFSET_INT)
KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_INST(Kokkos::complex<double>, int, int, Kokkos::LayoutRight, Kokkos::Cuda, Kokkos::CudaHostPinnedSpace, Kokkos::CudaHostPinnedSpace)
#endif
} // Impl
} // KokkosSparse
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
//@HEADER
// ************************************************************************
//
// KokkosKernels 0.9: Linear Algebra and Graph Kernels
// Copyright 2017 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/


#define KOKKOSKERNELS_IMPL_COMPILE_LIBRARY true
#include "KokkosSparse_gauss_seidel_spec.hpp"

namespace KokkosSparse {
namespace Impl {
#if defined (KOKKOSKERNELS_INST_KOKKOS_COMPLEX_DOUBLE_) \
&& defined (KOKKOSKERNELS_INST_LAYOUTLEFT) \
&& defined (KOKKOSKERNELS_INST_EXECSPACE_CUDA) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_MEMSPACE_CUDAHOSTPINNEDSPACE) \
&& defined (KOKKOSKERNELS_INST_ORDINAL_INT64_T) \
&& defined (KOKKOSKERNELS_INST_OFFSET_SIZE_T)
KOKKOSSPARSE_GAUSS_SEIDEL_APPLY_ETI_SPEC_INST(Kokkos::complex<double>, int64_t, size_t, Kokkos::LayoutLeft, Kokkos::Cuda, Kokkos::CudaHostPinnedSpace, Kokkos::CudaHostPinnedSpace)
#endif
} // Impl
} // KokkosSparse
Loading

0 comments on commit 025d71d

Please sign in to comment.