1 // generic vector class
2 //
3 // Copyright (C) 2010 Tim Blechmann
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; see the file COPYING. If not, write to
17 // the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 // Boston, MA 02111-1307, USA.
19
20 #ifndef VEC_HPP
21 #define VEC_HPP
22
23 #include "vec/vec_generic.hpp"
24
25 #ifdef __ARM_NEON__
26 # include "vec/vec_neon.hpp"
27 #endif
28
29 #ifdef __ALTIVEC__
30 # include "vec/vec_altivec.hpp"
31 #endif
32
33 #ifdef __AVX__
34 # include "vec/vec_avx_float.hpp"
35 #elif defined(__SSE__)
36 # include "vec/vec_sse.hpp"
37 #endif
38
39 #ifdef __AVX__
40 # include "vec/vec_avx_double.hpp"
41 #elif defined(__SSE2__)
42 # include "vec/vec_sse2.hpp"
43 #endif
44
45 namespace nova
46 {
47
48 template <typename T>
max_(T const & left,T const & right)49 T max_(T const & left, T const & right)
50 {
51 return std::max(left, right);
52 }
53
54 template <typename T>
min_(T const & left,T const & right)55 T min_(T const & left, T const & right)
56 {
57 return std::min(left, right);
58 }
59
60 }
61
62 #endif /* VEC_HPP */
63