BRL-CAD
simd.h
Go to the documentation of this file.
1 /* S I M D . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /** @file simd.h
22  *
23  */
24 #ifndef BU_SIMD_H
25 #define BU_SIMD_H
26 
27 #include "common.h"
28 
29 #include "bu/defines.h"
30 
32 
33 /** @addtogroup simd */
34 /** @{ */
35 
36 /** @file libbu/simd.c
37  * Detect SIMD type at runtime.
38  */
39 
40 #define BU_SIMD_SSE4_2 7
41 #define BU_SIMD_SSE4_1 6
42 #define BU_SIMD_SSE3 5
43 #define BU_SIMD_ALTIVEC 4
44 #define BU_SIMD_SSE2 3
45 #define BU_SIMD_SSE 2
46 #define BU_SIMD_MMX 1
47 #define BU_SIMD_NONE 0
48 /**
49  * Detect SIMD capabilities at runtime.
50  */
51 BU_EXPORT extern int bu_simd_level(void);
52 
53 /**
54  * Detect if requested SIMD capabilities are available at runtime.
55  * Returns 1 if they are, 0 if they are not.
56  */
57 BU_EXPORT extern int bu_simd_supported(int level);
58 
59 /** @} */
60 
62 
63 #endif /* BU_SIMD_H */
64 
65 /*
66  * Local Variables:
67  * mode: C
68  * tab-width: 8
69  * indent-tabs-mode: t
70  * c-file-style: "stroustrup"
71  * End:
72  * ex: shiftwidth=4 tabstop=8
73  */
Header file for the BRL-CAD common definitions.
#define __BEGIN_DECLS
Definition: common.h:73
int bu_simd_level(void)
Definition: simd.c:25
#define __END_DECLS
Definition: common.h:74
int bu_simd_supported(int level)
Definition: simd.c:52