|
|
Go to the documentation of this file. 1 #ifndef FWCore_Utilities_interface_CMSUnrollLoop_h
2 #define FWCore_Utilities_interface_CMSUnrollLoop_h
5 #define STRINGIFY_(ARG) #ARG
6 #define STRINGIFY(ARG) STRINGIFY_(ARG)
8 #if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__)
11 #define CMS_UNROLL_LOOP _Pragma(STRINGIFY(unroll))
12 #define CMS_UNROLL_LOOP_COUNT(N) _Pragma(STRINGIFY(unroll N))
13 #define CMS_UNROLL_LOOP_DISABLE _Pragma(STRINGIFY(unroll 1))
15 #define CMS_DEVICE_UNROLL_LOOP _Pragma(STRINGIFY(unroll))
16 #define CMS_DEVICE_UNROLL_LOOP_COUNT(N) _Pragma(STRINGIFY(unroll N))
17 #define CMS_DEVICE_UNROLL_LOOP_DISABLE _Pragma(STRINGIFY(unroll 1))
19 #else // defined (__CUDA_ARCH__) || defined (__HIP_DEVICE_COMPILE__)
22 #define CMS_DEVICE_UNROLL_LOOP
23 #define CMS_DEVICE_UNROLL_LOOP_COUNT(N)
24 #define CMS_DEVICE_UNROLL_LOOP_DISABLE
26 #if defined(__clang__)
29 #define CMS_UNROLL_LOOP _Pragma(STRINGIFY(clang loop unroll(enable)))
30 #define CMS_UNROLL_LOOP_COUNT(N) _Pragma(STRINGIFY(clang loop unroll_count(N)))
31 #define CMS_UNROLL_LOOP_DISABLE _Pragma(STRINGIFY(clang loop unroll(disable)))
33 #elif defined(__GNUC__)
36 #define CMS_UNROLL_LOOP _Pragma(STRINGIFY(GCC ivdep))
37 #define CMS_UNROLL_LOOP_COUNT(N) _Pragma(STRINGIFY(GCC unroll N)) _Pragma(STRINGIFY(GCC ivdep))
38 #define CMS_UNROLL_LOOP_DISABLE _Pragma(STRINGIFY(GCC unroll 1))
43 #define CMS_UNROLL_LOOP
44 #define CMS_UNROLL_LOOP_COUNT(N)
45 #define CMS_UNROLL_LOOP_DISABLE
47 #endif // defined(__clang__) || defined(__GNUC__) || ...
49 #endif // defined (__CUDA_ARCH__) || defined (__HIP_DEVICE_COMPILE__)
51 #endif // FWCore_Utilities_interface_CMSUnrollLoop_h