16#define CUDA_SKELETON_VOID(function_cuda, ...)\
17 function_cuda(__VA_ARGS__);\
19#define CUDA_SKELETON_VOID_T1(t1, function_cuda, ...)\
20 function_cuda<t1>(__VA_ARGS__);\
22#define CUDA_SKELETON_VOID_T2(t1, t2, function_cuda, ...)\
23 function_cuda<t1, t2>(__VA_ARGS__);\
26#define CUDA_SKELETON_VOID(function_cuda, ...)\
28#define CUDA_SKELETON_VOID_T1(t1, function_cuda, ...)\
30#define CUDA_SKELETON_VOID_T2(t1, t2, function_cuda, ...)\
35#define MKL_SKELETON_VOID(function_mkl, ...)\
36 function_mkl(__VA_ARGS__);\
38#define MKL_SKELETON_VOID_T1(t1, function_mkl, ...)\
39 function_mkl<t1>(__VA_ARGS__);\
41#define MKL_SKELETON_VOID_T2(t1, t2, function_mkl, ...)\
42 function_mkl<t1, t2 >(__VA_ARGS__);\
45#define MKL_SKELETON_VOID(function_mkl, ...)\
47#define MKL_SKELETON_VOID_T1(t1, function_mkl, ...)\
49#define MKL_SKELETON_VOID_T2(t1, t2, function_mkl, ...)\
53#define BACKEND_SKELETON_VOID(function_cuda, function_mkl, function_generic, ...)\
54 switch(Backend::get_preferred_backend())\
56 case FEAT::PreferredBackend::cuda:\
57 CUDA_SKELETON_VOID(function_cuda, __VA_ARGS__)\
58 case FEAT::PreferredBackend::mkl:\
59 MKL_SKELETON_VOID(function_mkl, __VA_ARGS__)\
60 case FEAT::PreferredBackend::generic:\
62 function_generic(__VA_ARGS__);\
66#define BACKEND_SKELETON_VOID_T1(t1, function_cuda, function_mkl, function_generic, ...)\
67 switch(Backend::get_preferred_backend())\
69 case FEAT::PreferredBackend::cuda:\
70 CUDA_SKELETON_VOID_T1(t1, function_cuda, __VA_ARGS__)\
71 case FEAT::PreferredBackend::mkl:\
72 MKL_SKELETON_VOID_T1(t1, function_mkl, __VA_ARGS__)\
73 case FEAT::PreferredBackend::generic:\
75 function_generic<t1>(__VA_ARGS__);\
79#define BACKEND_SKELETON_VOID_T2(t1, t2, function_cuda, function_mkl, function_generic, ...)\
80 switch(Backend::get_preferred_backend())\
82 case FEAT::PreferredBackend::cuda:\
83 CUDA_SKELETON_VOID_T2(t1, t2, function_cuda, __VA_ARGS__)\
84 case FEAT::PreferredBackend::mkl:\
85 MKL_SKELETON_VOID_T2(t1, t2, function_mkl, __VA_ARGS__)\
86 case FEAT::PreferredBackend::generic:\
88 function_generic<t1, t2>(__VA_ARGS__);\
93#define CUDA_SKELETON_RETURN(function_cuda, ...)\
94 return function_cuda(__VA_ARGS__);
96#define CUDA_SKELETON_RETURN(function_cuda, ...)\
101#define MKL_SKELETON_RETURN(function_mkl, ...)\
102 return function_mkl(__VA_ARGS__);
104#define MKL_SKELETON_RETURN(function_mkl, ...)\
108#define BACKEND_SKELETON_RETURN(function_cuda, function_mkl, function_generic, ...)\
109 switch(Backend::get_preferred_backend())\
111 case FEAT::PreferredBackend::cuda:\
112 CUDA_SKELETON_RETURN(function_cuda, __VA_ARGS__)\
113 case FEAT::PreferredBackend::mkl:\
114 MKL_SKELETON_RETURN(function_mkl, __VA_ARGS__)\
115 case FEAT::PreferredBackend::generic:\
117 return function_generic(__VA_ARGS__);\
static PreferredBackend _preferred_backend
the currently preferred backend
PreferredBackend
The backend that shall be used in all compute heavy calculations.