MADNESS  version 0.9
madness_config.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2014 Virginia Tech
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31 */
32 #ifndef MADNESS_MADNESS_CONFIG_H__INCLUDED
33 #define MADNESS_MADNESS_CONFIG_H__INCLUDED
34 
35 #include <madness/config.h>
36 
37 /* System check */
38 #if defined(__CRAYXT)
39 
40 # define HAVE_CRAYXT 1
41 # define MADNESS_HAVE_CRAYXT 1
42 
43 #elif defined(__CRAYXE)
44 
45 # define HAVE_CRAYXE 1
46 # define MADNESS_HAVE_CRAYXE 1
47 # define X86_64 1
48 # define MADNESS_HAVE_X86_64 1
49 
50 #elif defined(__bgp__)
51 
52 # define HAVE_IBMBGP 1
53 # define MADNESS_HAVE_POWERPC_32 1
54 
55 #elif defined(__bgq__)
56 
57 # define HAVE_IBMBGQ 1
58 # define MADNESS_HAVE_POWERPC_64 1
59 
60 #endif /* System check */
61 
62 
63 /* Processor and instruction set checks */
64 #if defined(__x86_64__) || defined(_M_X64)
65  /* x86 64-bit */
66 # define X86_64 1
67 # define MADNESS_HAVE_X86_64 1
68 
69 # if defined(__AVX2__)
70 # define MADNESS_HAVE_AVX2 1
71 # endif
72 
73 # if defined(__AVX__)
74 # define MADNESS_HAVE_AVX 1
75 # endif
76 
77 # if defined(__SSE4_2__)
78 # define MADNESS_HAVE_SSE42 1
79 # endif
80 
81 # if defined(__SSE4_1__)
82 # define MADNESS_SSE41 1
83 # endif
84 
85 # if defined(__SSSE3__)
86 # define MADNESS_HAVE_SSSE3 1
87 # endif
88 
89 # if defined(__SSE3__)
90 # define MADNESS_HAVE_SSE3 1
91 # endif
92 
93 /* x86 64-bit always has SSE2 */
94 # define MADNESS_HAVE_SSE2 1
95 # define MADNESS_HAVE_SSE 1
96 
97 # if defined(_M_IX86_FP) /* Defined in MS compiler. 1 = SSE, 2: SSE2 */
98 
99 # if _M_IX86_FP == 2
100 # define MADNESS_HAVE_SSE2 2
101 # elif _M_IX86_FP == 1
102 # define MADNESS_HAVE_SSE 1
103 # endif
104 
105 # endif /* defined(_M_IX86_FP) */
106 
107 
108 #elif defined(__i386) || defined(_M_IX86)
109  /* x86 32-bit */
110 # define X86_32
111 # define MADNESS_HAVE_X86_32
112 
113 # if defined(__SSE2__)
114 # define MADNESS_HAVE_SSE2 2
115 # endif
116 
117 # if defined(__SSE__)
118 # define MADNESS_HAVE_SSE 1
119 # endif
120 
121 #endif /* x86 */
122 
123 
124 #if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
125  /* POWER PC */
126 
127 # if defined(__powerpc64__) || defined(__ppc64__) || defined(__PPC64__) || \
128  defined(__64BIT__) || defined(_LP64) || defined(__LP64__)
129  /* POWER PC 64-bit */
130 # define MADNESS_HAVE_POWERPC_64 1
131 
132 # else
133  /* POWER PC 32-bit */
134 # define MADNESS_HAVE_POWERPC_32 1
135 
136 # endif
137 
138 #endif /* POWERPC */
139 
140 
141 #endif // MADNESS_MADNESS_CONFIG_H__INCLUDED