MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
common_magma.h
Go to the documentation of this file.
1 
19 /***************************************************************************/
22 #ifndef _MAGMA_COMMON_H_
23 #define _MAGMA_COMMON_H_
24 
25 #include <stdio.h>
26 #include <cuda.h>
27 #include <cuda_runtime_api.h>
28 #include <cublas.h>
29 #include <math.h>
30 #include <string.h>
31 #include <ctype.h>
32 
33 #if defined( _WIN32 ) || defined( _WIN64 )
34 
35 # include "magmawinthread.h"
36 # include <windows.h>
37 # include <limits.h>
38 # include <io.h>
39 
40 #else
41 
42 # include <pthread.h>
43 # include <unistd.h>
44 # include <inttypes.h>
45 
46 #endif
47 
48 #include "magma.h"
49 #include "magma_lapack.h"
50 #include "operators.h"
51 #include "transpose.h"
52 
57 #if __STDC_VERSION__ < 199901L
58 # if __GNUC__ >= 2 || _MSC_VER >= 1300
59 # define __func__ __FUNCTION__
60 # else
61 # define __func__ "<unknown>"
62 # endif
63 #endif
64 
68 #if defined(linux) || defined(__linux) || defined(__linux__)
69 #if defined(__GNUC_EXCL__) || defined(__GNUC__)
70 #define MAGMA_HAVE_WEAK 1
71 #endif
72 #endif
73 
74 /***************************************************************************/
77 #ifndef max
78 #define max(a, b) ((a) > (b) ? (a) : (b))
79 #endif
80 #ifndef min
81 #define min(a, b) ((a) < (b) ? (a) : (b))
82 #endif
83 #ifndef roundup
84 #define roundup(a, b) (b <= 0) ? (a) : (((a) + (b)-1) & ~((b)-1))
85 #endif
86 
92 #define magma_dsqrt sqrt
93 #define magma_ssqrt sqrt
94 
95 #endif /* _MAGMA_COMMON_H_ */