Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_Tpetra_ETI_Helpers_UQ_PCE.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Stokhos Package
5 // Copyright (2009) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 // UQ::PCE includes
44 #include "TpetraCore_ETIHelperMacros.h"
45 
46 #define INSTANTIATE_UQ_PCE_STORAGE(INSTMACRO, STORAGE, LO, GO, N) \
47  INSTMACRO( Sacado::UQ::PCE<STORAGE>, LO, GO, N )
48 
49 #define INSTANTIATE_UQ_PCE_DS_SLD(INSTMACRO, S, L, D, LO, GO, N) \
50  typedef Stokhos::DynamicStorage<L,S,D::execution_space> DS_ ## L ## _ ## S ## _ ## _ ## D; \
51  INSTANTIATE_UQ_PCE_STORAGE(INSTMACRO, DS_ ## L ## _ ## S ## _ ## _ ## D, LO, GO, N)
52 
53 #define INSTANTIATE_UQ_PCE_S_D(INSTMACRO, D, LO, GO, N) \
54  INSTANTIATE_UQ_PCE_DS_SLD(INSTMACRO, double, int, D, LO, GO, N)
55 
56 #define INSTANTIATE_UQ_PCE_S(INSTMACRO, LO, GO, N) \
57  typedef Stokhos::DeviceForNode2<N>::type DFN_ ## LO ## _ ## GO ## _ ## N; \
58  INSTANTIATE_UQ_PCE_S_D(INSTMACRO, DFN_ ## LO ## _ ## GO ## _ ## N, LO, GO, N)
59 
60 #define INSTANTIATE_UQ_PCE(INSTMACRO, LO, GO, N) \
61  INSTANTIATE_UQ_PCE_S(INSTMACRO, LO, GO, N)
62 
63 #define INSTANTIATE_TPETRA_UQ_PCE_N(INSTMACRO, N) \
64  using default_local_ordinal_type = Tpetra::Map<>::local_ordinal_type; \
65  using default_global_ordinal_type = Tpetra::Map<>::global_ordinal_type; \
66  INSTANTIATE_UQ_PCE_S(INSTMACRO, default_local_ordinal_type, default_global_ordinal_type, N)
67 
68 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_SERIAL)
69 #define INSTANTIATE_TPETRA_UQ_PCE_SERIAL(INSTMACRO) \
70  INSTMACRO(Kokkos_Compat_KokkosSerialWrapperNode)
71 #else
72 #define INSTANTIATE_TPETRA_UQ_PCE_SERIAL(INSTMACRO)
73 #endif
74 
75 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_PTHREAD)
76 #define INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO) \
77  INSTMACRO(Kokkos_Compat_KokkosThreadsWrapperNode)
78 #else
79 #define INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO)
80 #endif
81 
82 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_OPENMP)
83 #define INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO) \
84  INSTMACRO(Kokkos_Compat_KokkosOpenMPWrapperNode)
85 #else
86 #define INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO)
87 #endif
88 
89 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_CUDA)
90 #define INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO) \
91  INSTMACRO(Kokkos_Compat_KokkosCudaWrapperNode)
92 #else
93 #define INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO)
94 #endif
95 
96 #define INSTANTIATE_TPETRA_UQ_PCE_WRAPPER_NODES(INSTMACRO) \
97  INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO) \
98  INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO) \
99  INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO)
100 
101 #define INSTANTIATE_TPETRA_UQ_PCE(INSTMACRO) \
102  namespace Tpetra { \
103  \
104  TPETRA_ETI_MANGLING_TYPEDEFS() \
105  \
106  INSTANTIATE_TPETRA_UQ_PCE_WRAPPER_NODES(INSTMACRO) \
107  \
108 }