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  INSTANTIATE_UQ_PCE_S(INSTMACRO, int, int, N)
65 
66 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_SERIAL)
67 #define INSTANTIATE_TPETRA_UQ_PCE_SERIAL(INSTMACRO) \
68  INSTMACRO(Kokkos_Compat_KokkosSerialWrapperNode)
69 #else
70 #define INSTANTIATE_TPETRA_UQ_PCE_SERIAL(INSTMACRO)
71 #endif
72 
73 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_PTHREAD)
74 #define INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO) \
75  INSTMACRO(Kokkos_Compat_KokkosThreadsWrapperNode)
76 #else
77 #define INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO)
78 #endif
79 
80 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_OPENMP)
81 #define INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO) \
82  INSTMACRO(Kokkos_Compat_KokkosOpenMPWrapperNode)
83 #else
84 #define INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO)
85 #endif
86 
87 #if defined(HAVE_TPETRACORE_TEUCHOSKOKKOSCOMPAT) && defined(HAVE_TPETRA_INST_CUDA)
88 #define INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO) \
89  INSTMACRO(Kokkos_Compat_KokkosCudaWrapperNode)
90 #else
91 #define INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO)
92 #endif
93 
94 #define INSTANTIATE_TPETRA_UQ_PCE_WRAPPER_NODES(INSTMACRO) \
95  INSTANTIATE_TPETRA_UQ_PCE_THREADS(INSTMACRO) \
96  INSTANTIATE_TPETRA_UQ_PCE_OPENMP(INSTMACRO) \
97  INSTANTIATE_TPETRA_UQ_PCE_CUDA(INSTMACRO)
98 
99 #define INSTANTIATE_TPETRA_UQ_PCE(INSTMACRO) \
100  namespace Tpetra { \
101  \
102  TPETRA_ETI_MANGLING_TYPEDEFS() \
103  \
104  INSTANTIATE_TPETRA_UQ_PCE_WRAPPER_NODES(INSTMACRO) \
105  \
106 }