cblas_inc.hpp
Go to the documentation of this file.
1 /*!
2  *
3  *
4  * \brief -
5  *
6  * \author -
7  * \date -
8  *
9  *
10  * \par Copyright 1995-2015 Shark Development Team
11  *
12  * <BR><HR>
13  * This file is part of Shark.
14  * <http://image.diku.dk/shark/>
15  *
16  * Shark is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU Lesser General Public License as published
18  * by the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * Shark is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public License
27  * along with Shark. If not, see <http://www.gnu.org/licenses/>.
28  *
29  */
30 
31 #ifndef SHARK_LINALG_BLAS_KERNELS_CBLAS_CBLAS_INC_HPP
32 #define SHARK_LINALG_BLAS_KERNELS_CBLAS_CBLAS_INC_HPP
33 
34 #ifdef __APPLE__
35 
36 #ifdef __ASSERTMACROS__ //is AssertMacros already included?
37 //AssertMacros automatically defines __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES as 1
38 //if not already included
39 #if __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES
40 #warning "AssertMacros.h already included by some file. Disabling macros as otherwise compilation will fail"
41 
42 //incomplete list (probably the worst offenders that will fail compilation.
43 #ifdef check
44  #undef check
45 #endif
46 #ifdef require
47  #undef require
48 #endif
49 #ifdef verify
50  #undef verify
51 #endif
52 
53 #endif
54 #else
55 //noone included it yet, so we can just prevent these macros...
56 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
57 #endif
58 
59 // included to make Accelerate work with boost on MacOS
60 #include <boost/intrusive/list.hpp>
61 
62 // Accelerate framework support added by TG 19.06.2015
63 extern "C" {
64 #include <Accelerate/Accelerate.h>
65 }
66 #undef nil
67 
68 #else
69 
70 extern "C" {
71 #include <cblas.h>
72 }
73 
74 #endif
75 
76 //all atlas using functions need this anyway...
77 //so we prevent multiple includes in all atlas using functions
78 //which should decrease compile time a small bit
79 #include <shark/Core/Exception.h>
80 #include <complex>
81 #include <boost/mpl/bool.hpp>
82 #include "../traits.hpp"
83 
84 namespace shark {
85 namespace blas {
86 namespace bindings {
87 
88 template <typename Ord> struct storage_order {};
89 template<> struct storage_order<row_major> {
90  enum ename { value = CblasRowMajor };
91 };
92 template<> struct storage_order<column_major> {
93  enum ename { value = CblasColMajor };
94 };
95 
96 }}}
97 
98 #ifndef OPENBLAS_CONST
99 typedef void cblas_float_complex_type;
100 typedef void cblas_double_complex_type;
101 #else
102 typedef float cblas_float_complex_type;
103 typedef double cblas_double_complex_type;
104 #endif
105 
106 
107 #endif