QDP++
qdp.h
Go to the documentation of this file.
1// -*- C++ -*-
2
8
25
26/*! \namespace QDP
27 * \brief Primary namespace holding all QDP types, operations and objects
28 */
29
30#ifndef QDP_INCLUDE
31#define QDP_INCLUDE
32
33
34#include "qdp_diagnostics.h"
35
36/* Get local configuration options (ARCH_SCALAR/PARSCALAR, Nd, Nc, Ns) */
37#include <qdp_config.h>
38#include "qdp_precision.h"
39
40// GNU specific stuff
41#if defined(__GNUC__)
42// Under g++, enforce using V3 or greater
43#if __GNUC__ < 3
44#error "QDP++ requires g++ 3.0 or higher. This version of the g++ compiler is not supported"
45#endif
46#endif
47
48// Under gcc, set some attributes
49#if defined(__GNUC__)
50// gcc
51#define QDP_ALIGN8 __attribute__ ((aligned (8)))
52#define QDP_ALIGN16 __attribute__ ((aligned (16)))
53#define QDP_INLINE __attribute__ ((always_inline))
54// The attributes in QDP_CONST is buggering g++-3.4
55//#define QDP_CONST __attribute__ ((const,pure))
56#define QDP_CONST
57#define QDP_CINLINE __attribute__ ((always_inline,const,pure))
58#else
59// default
60#define QDP_ALIGN8
61#define QDP_ALIGN16
62#define QDP_INLINE
63#define QDP_CONST
64#define QDP_CINLINE
65#endif
67#if (QDP_USE_SSE == 1 || QDP_USE_SSE2 == 1) && ! defined(__GNUC__)
68// SSE requires GNUC
69#undef QDP_USE_SSE
70#undef QDP_USE_SSE2
71
72#define QDP_USE_SSE 0
73#define QDP_USE_SSE2 0
74#endif
76// Commented this out and set QDP_ALIGNMENT_SIZE to be 16 all the time
77// This is a minimal waste of space and should allow an SSE dslash
78// to be used even if the QDP itself is not compiled with SSE.
79#ifdef QDP_AC_ALIGNMENT_SIZE
80#define QDP_ALIGNMENT_SIZE QDP_AC_ALIGNMENT_SIZE
81#else
82#define QDP_ALIGNMENT_SIZE 16
83#endif
85// YUKKY - Eventually get rid of these includes
86#include <cstdio>
87#include <cstdlib>
88#include <ostream>
89#include <iostream>
91#if 0
92// NOTE: having this off will probably break a bunch of old code.
93using namespace std;
94using std::iostream;
95using std::ostream;
96#endif
97// END OF YUKKINESS
98
100// Basic includes
101#define PETE_USER_DEFINED_EXPRESSION
102namespace QDP {
103#include <PETE/PETE.h>
106#include "qdp_init.h"
108#include "qdp_multi.h"
109#include "qdp_arrays.h"
110
111#include "qdp_params.h"
112#include "qdp_layout.h"
113#include "qdp_io.h"
114#include "qdp_stdio.h"
116#ifndef QDP_USE_LIBXML2
117QDPXX_MESSAGE("not using libxml2")
118#else
119#include "qdp_xmlio.h"
120#include "qdp_qdpio.h"
121#endif
123#ifndef QDP_USE_HDF5
124QDPXX_MESSAGE("not using hdf5")
125#else
126#include "qdp_hdf5.h"
127#endif
129#include "qdp_subset.h"
130#include "qdp_map.h"
133#include "qdp_traits.h"
135#include "qdp_qdptype.h"
138namespace QDP {
142// Include the allocator stuff here, before QDP_outer
146#include "qdp_optops.h"
148//#include "qdp_word.h"
151#include "qdp_inner.h"
153#include "qdp_outer.h"
155
156// Replaces previous ifdef structure. Structure moved into the header file
157#include "qdp_defs.h"
161//#include "qdp_special.h"
162#include "qdp_random.h"
164// Include threading code here if applicable
171#if defined(ARCH_SCALAR)
172// Architectural specific code to a single node/single proc box
173QDPXX_MESSAGE("Using scalar architecture")
174#include "qdp_scalar_specific.h"
176// Include SSE code here if applicable
177#if QDP_USE_SSE == 1
179#elif QDP_USE_BAGEL_QDP == 1
180// USE_BAGEL_QDP
182#else
183// Use Generics only
184#ifdef QDP_USE_GENERIC_OPTS
185QDPXX_MESSAGE("Using generics")
186#include "qdp_scalarsite_generic.h"
187#else
188QDPXX_MESSAGE("Not using generics")
189#endif
190#endif
192#elif defined(ARCH_PARSCALAR)
193// Architectural specific code to a parallel/single proc box
194QDPXX_MESSAGE("Using parallel scalar architecture")
195#include "qdp_parscalar_specific.h"
197// Include optimized code here if applicable
198#if QDP_USE_SSE == 1
199#include "qdp_scalarsite_sse.h"
200#elif QDP_USE_BAGEL_QDP == 1
201// Use BAGEL_QDP
203#else
204// Use generics
205#ifdef QDP_USE_GENERIC_OPTS
207#else
208QDPXX_MESSAGE("Not using generics")
209#endif
210#endif
212#elif defined(ARCH_SCALARVEC)
213// Architectural specific code to a single node/single proc box
214// with vector extension
215QDPXX_MESSAGE("Using scalar architecture with vector extensions")
216#include "qdp_scalarvec_specific.h"
218// Include optimized code here if applicable
219#if QDP_USE_SSE == 1
221#endif
223#elif defined(ARCH_PARSCALARVEC)
224// Architectural specific code to a parallel/single proc box
225// with vector extension
226QDPXX_MESSAGE("Using parallel scalar architecture with vector extensions")
227#include "qdp_parscalarvec_specific.h"
229// Include optimized code here if applicable
230#if QDP_USE_SSE == 1
232#endif
234#else
235#error "Unknown architecture ARCH"
236#endif
237
241#endif // QDP_INCLUDE
Bulk of QDP operators produced by PETE.
Yet another random number generator.
Catch-alls for all memory allocators.
One based arrays.
#define QDPXX_MESSAGE(s)
Flop counters.
Forward declarations for QDP.
Global functions on QDPType.
HDF5 support.
Routines for top level QDP management.
Inner grid.
IO support.
Lattice layout.
Map classes.
Multi-dimensional arrays.
Additional operations on QDPTypes.
PETE optimized operations on QDPTypes.
Outer grid classes.
Outer grid classes after a subset.
Fundamental parameters.
PRECISION ISSUES.
Primitive classes.
Print profiling info.
Expression class for QDP.
IO support via QIO.
QDPType after a subset.
Main type class for QDP.
Qcdoc optimizations.
Generic optimizations.
Intel SSE optimizations.
Intel SSE optimizations.
QDP Operations on built-in types.
Parallel version of stdio.
Timer support.
Sets and subsets.
Traits classes.
XML IO support.