Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Details_FixedHashTable_Cuda.cpp
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "Tpetra_Details_FixedHashTable_decl.hpp"
11 
12 #if defined(HAVE_TPETRA_EXPLICIT_INSTANTIATION) && defined(KOKKOS_ENABLE_CUDA)
13 
14 #include "TpetraCore_ETIHelperMacros.h"
15 #include "Tpetra_Details_FixedHashTable_def.hpp"
16 
17 namespace Tpetra {
18 namespace Details {
19 
20  TPETRA_ETI_MANGLING_TYPEDEFS()
21 
22  typedef Kokkos::Device<Kokkos::Cuda, Kokkos::CudaSpace> cuda_device_type;
23 
24  typedef Kokkos::Device<Kokkos::Cuda, Kokkos::CudaUVMSpace> cuda_uvm_device_type;
25 
26 #define TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA( LO, GO ) \
27  TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT( LO, GO, cuda_device_type )
28 
29  TPETRA_INSTANTIATE_LG( TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA )
30 
31 #define TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA_UVM( LO, GO ) \
32  TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT( LO, GO, cuda_uvm_device_type )
33 
34  TPETRA_INSTANTIATE_LG( TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA_UVM )
35 
36  // mfh 26 Sep 2015: Make sure that the {KeyType = LO, ValueType =
37  // LO} and {KeyType = int, ValueType = LO} specializations get
38  // built, since Directory needs them.
39 
40  // KeyType = int doesn't get built if GO = int is disabled.
41 #ifndef HAVE_TPETRA_INST_INT_INT
42 # define TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA_INT( LO ) \
43  TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT( LO, int, cuda_device_type ) \
44  TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT( LO, int, cuda_uvm_device_type )
45 
46  TPETRA_INSTANTIATE_L( TPETRA_DETAILS_FIXEDHASHTABLE_INSTANT_CUDA_INT )
47 
48  // FIXME (mfh 26 Sep 2015) Once it becomes possible to disable LO =
49  // int, add an instantiation here for {KeyType = LO, ValueType =
50  // LO}. However, this case has likely already been covered above,
51  // since disabling LO = int leaves LO = GO = long or long long as
52  // the most reasonable options. (It would be silly to use LO = long
53  // and GO = long long if sizeof(long) = sizeof(long long).)
54 
55 #endif // HAVE_TPETRA_INST_INT_INT
56 
57 } // namespace Details
58 } // namespace Tpetra
59 
60 #endif // defined(HAVE_TPETRA_EXPLICIT_INSTANTIATION) && defined(KOKKOS_ENABLE_CUDA)