45 #ifndef KOKKOS_NUMERIC_TRAITS_HPP 46 #define KOKKOS_NUMERIC_TRAITS_HPP 48 #include <Kokkos_Macros.hpp> 53 #include <type_traits> 59 template <
class>
struct infinity_helper;
60 template <>
struct infinity_helper<float> {
static constexpr
float value = HUGE_VALF; };
61 template <>
struct infinity_helper<double> {
static constexpr
double value = HUGE_VAL; };
62 template <>
struct infinity_helper<long double> {
static constexpr
long double value = HUGE_VALL; };
63 template <
class>
struct finite_min_helper;
64 template <>
struct finite_min_helper<bool> {
static constexpr
bool value =
false; };
65 template <>
struct finite_min_helper<char> {
static constexpr
char value = CHAR_MIN; };
66 template <>
struct finite_min_helper<signed char> {
static constexpr
signed char value = SCHAR_MIN; };
67 template <>
struct finite_min_helper<unsigned char> {
static constexpr
unsigned char value = 0; };
68 template <>
struct finite_min_helper<short> {
static constexpr
short value = SHRT_MIN; };
69 template <>
struct finite_min_helper<unsigned short> {
static constexpr
unsigned short value = 0; };
70 template <>
struct finite_min_helper<int> {
static constexpr
int value = INT_MIN; };
71 template <>
struct finite_min_helper<unsigned int> {
static constexpr
unsigned int value = 0; };
72 template <>
struct finite_min_helper<long int> {
static constexpr
long int value = LONG_MIN; };
73 template <>
struct finite_min_helper<unsigned long int> {
static constexpr
unsigned long int value = 0; };
74 template <>
struct finite_min_helper<long long int> {
static constexpr
long long int value = LLONG_MIN; };
75 template <>
struct finite_min_helper<unsigned long long int> {
static constexpr
unsigned long long int value = 0; };
76 template <>
struct finite_min_helper<float> {
static constexpr
float value = -FLT_MAX; };
77 template <>
struct finite_min_helper<double> {
static constexpr
double value = -DBL_MAX; };
78 template <>
struct finite_min_helper<long double> {
static constexpr
long double value = -LDBL_MAX; };
79 template <
class>
struct finite_max_helper;
80 template <>
struct finite_max_helper<bool> {
static constexpr
bool value =
true; };
81 template <>
struct finite_max_helper<char> {
static constexpr
char value = CHAR_MAX; };
82 template <>
struct finite_max_helper<signed char> {
static constexpr
signed char value = SCHAR_MAX; };
83 template <>
struct finite_max_helper<unsigned char> {
static constexpr
unsigned char value = UCHAR_MAX; };
84 template <>
struct finite_max_helper<short> {
static constexpr
short value = SHRT_MAX; };
85 template <>
struct finite_max_helper<unsigned short> {
static constexpr
unsigned short value = USHRT_MAX; };
86 template <>
struct finite_max_helper<int> {
static constexpr
int value = INT_MAX; };
87 template <>
struct finite_max_helper<unsigned int> {
static constexpr
unsigned int value = UINT_MAX; };
88 template <>
struct finite_max_helper<long int> {
static constexpr
long int value = LONG_MAX; };
89 template <>
struct finite_max_helper<unsigned long int> {
static constexpr
unsigned long int value = ULONG_MAX; };
90 template <>
struct finite_max_helper<long long int> {
static constexpr
long long int value = LLONG_MAX; };
91 template <>
struct finite_max_helper<unsigned long long int> {
static constexpr
unsigned long long int value = ULLONG_MAX; };
92 template <>
struct finite_max_helper<float> {
static constexpr
float value = FLT_MAX; };
93 template <>
struct finite_max_helper<double> {
static constexpr
double value = DBL_MAX; };
94 template <>
struct finite_max_helper<long double> {
static constexpr
long double value = LDBL_MAX; };
95 template <
class>
struct epsilon_helper;
99 constexpr T machineeps() {
100 T epsilon = 1, prev = 1, expression = 1;
104 expression = 1 + epsilon;
105 }
while (expression > 1);
109 template <>
struct epsilon_helper<float> {
static constexpr
float value = FLT_EPSILON; };
110 template <>
struct epsilon_helper<double> {
static constexpr
double value = DBL_EPSILON; };
111 template <>
struct epsilon_helper<long double> {
112 #ifdef KOKKOS_COMPILER_IBM 113 static constexpr
long double value = machineeps<long double>();
115 static constexpr
long double value = LDBL_EPSILON;
118 template <
class>
struct round_error_helper;
119 template <>
struct round_error_helper<float> {
static constexpr
float value = 0.5F; };
120 template <>
struct round_error_helper<double> {
static constexpr
double value = 0.5; };
121 template <>
struct round_error_helper<long double> {
static constexpr
long double value = 0.5L; };
122 template <
class>
struct norm_min_helper;
123 template <>
struct norm_min_helper<float> {
static constexpr
float value = FLT_MIN; };
124 template <>
struct norm_min_helper<double> {
static constexpr
double value = DBL_MIN; };
125 template <>
struct norm_min_helper<long double> {
static constexpr
long double value = LDBL_MIN; };
126 template <
class>
struct digits_helper;
127 template <>
struct digits_helper<bool> {
static constexpr
int value = 1; };
128 template <>
struct digits_helper<char> {
static constexpr
int value = CHAR_BIT - std::is_signed<char>::value; };
129 template <>
struct digits_helper<signed char> {
static constexpr
int value = CHAR_BIT - 1; };
130 template <>
struct digits_helper<unsigned char> {
static constexpr
int value = CHAR_BIT; };
131 template <>
struct digits_helper<short> {
static constexpr
int value = CHAR_BIT*
sizeof(short)-1; };
132 template <>
struct digits_helper<unsigned short> {
static constexpr
int value = CHAR_BIT*
sizeof(short); };
133 template <>
struct digits_helper<int> {
static constexpr
int value = CHAR_BIT*
sizeof(int)-1; };
134 template <>
struct digits_helper<unsigned int> {
static constexpr
int value = CHAR_BIT*
sizeof(int); };
135 template <>
struct digits_helper<long int> {
static constexpr
int value = CHAR_BIT*
sizeof(
long int)-1; };
136 template <>
struct digits_helper<unsigned long int> {
static constexpr
int value = CHAR_BIT*
sizeof(
long int); };
137 template <>
struct digits_helper<long long int> {
static constexpr
int value = CHAR_BIT*
sizeof(
long long int)-1; };
138 template <>
struct digits_helper<unsigned long long int> {
static constexpr
int value = CHAR_BIT*
sizeof(
long long int); };
139 template <>
struct digits_helper<float> {
static constexpr
int value = FLT_MANT_DIG; };
140 template <>
struct digits_helper<double> {
static constexpr
int value = DBL_MANT_DIG; };
141 template <>
struct digits_helper<long double> {
static constexpr
int value = LDBL_MANT_DIG; };
142 template <
class>
struct digits10_helper;
143 template <>
struct digits10_helper<bool> {
static constexpr
int value = 0; };
144 constexpr
double log10_2 = 2.41;
145 #define DIGITS10_HELPER_INTEGRAL(TYPE) \ 146 template <> struct digits10_helper<TYPE> { static constexpr int value = digits_helper<TYPE>::value * log10_2; }; 147 DIGITS10_HELPER_INTEGRAL(
char)
148 DIGITS10_HELPER_INTEGRAL(
signed char)
149 DIGITS10_HELPER_INTEGRAL(
unsigned char)
150 DIGITS10_HELPER_INTEGRAL(
short)
151 DIGITS10_HELPER_INTEGRAL(
unsigned short)
152 DIGITS10_HELPER_INTEGRAL(
int)
153 DIGITS10_HELPER_INTEGRAL(
unsigned int)
154 DIGITS10_HELPER_INTEGRAL(
long int)
155 DIGITS10_HELPER_INTEGRAL(
unsigned long int)
156 DIGITS10_HELPER_INTEGRAL(
long long int)
157 DIGITS10_HELPER_INTEGRAL(
unsigned long long int)
158 #undef DIGITS10_HELPER_INTEGRAL 159 template <>
struct digits10_helper<float> {
static constexpr
int value = FLT_DIG; };
160 template <>
struct digits10_helper<double> {
static constexpr
int value = DBL_DIG; };
161 template <>
struct digits10_helper<long double> {
static constexpr
int value = LDBL_DIG; };
162 template <
class>
struct max_digits10_helper;
167 template <>
struct max_digits10_helper<float> {
static constexpr
int value = 9; };
168 template <>
struct max_digits10_helper<double> {
static constexpr
int value = 17; };
169 template <>
struct max_digits10_helper<long double> {
static constexpr
int value = 21; };
170 template <
class>
struct radix_helper;
171 template <>
struct radix_helper<bool> {
static constexpr
int value = 2; };
172 template <>
struct radix_helper<char> {
static constexpr
int value = 2; };
173 template <>
struct radix_helper<signed char> {
static constexpr
int value = 2; };
174 template <>
struct radix_helper<unsigned char> {
static constexpr
int value = 2; };
175 template <>
struct radix_helper<short> {
static constexpr
int value = 2; };
176 template <>
struct radix_helper<unsigned short> {
static constexpr
int value = 2; };
177 template <>
struct radix_helper<int> {
static constexpr
int value = 2; };
178 template <>
struct radix_helper<unsigned int> {
static constexpr
int value = 2; };
179 template <>
struct radix_helper<long int> {
static constexpr
int value = 2; };
180 template <>
struct radix_helper<unsigned long int> {
static constexpr
int value = 2; };
181 template <>
struct radix_helper<long long int> {
static constexpr
int value = 2; };
182 template <>
struct radix_helper<unsigned long long int> {
static constexpr
int value = 2; };
183 template <>
struct radix_helper<float> {
static constexpr
int value = FLT_RADIX; };
184 template <>
struct radix_helper<double> {
static constexpr
int value = FLT_RADIX; };
185 template <>
struct radix_helper<long double> {
static constexpr
int value = FLT_RADIX; };
186 template <
class>
struct min_exponent_helper;
187 template <>
struct min_exponent_helper<float> {
static constexpr
int value = FLT_MIN_EXP; };
188 template <>
struct min_exponent_helper<double> {
static constexpr
int value = DBL_MIN_EXP; };
189 template <>
struct min_exponent_helper<long double> {
static constexpr
int value = LDBL_MIN_EXP; };
190 template <
class>
struct min_exponent10_helper;
191 template <>
struct min_exponent10_helper<float> {
static constexpr
int value = FLT_MIN_10_EXP; };
192 template <>
struct min_exponent10_helper<double> {
static constexpr
int value = DBL_MIN_10_EXP; };
193 template <>
struct min_exponent10_helper<long double> {
static constexpr
int value = LDBL_MIN_10_EXP; };
194 template <
class>
struct max_exponent_helper;
195 template <>
struct max_exponent_helper<float> {
static constexpr
int value = FLT_MAX_EXP; };
196 template <>
struct max_exponent_helper<double> {
static constexpr
int value = DBL_MAX_EXP; };
197 template <>
struct max_exponent_helper<long double> {
static constexpr
int value = LDBL_MAX_EXP; };
198 template <
class>
struct max_exponent10_helper;
199 template <>
struct max_exponent10_helper<float> {
static constexpr
int value = FLT_MAX_10_EXP; };
200 template <>
struct max_exponent10_helper<double> {
static constexpr
int value = DBL_MAX_10_EXP; };
201 template <>
struct max_exponent10_helper<long double> {
static constexpr
int value = LDBL_MAX_10_EXP; };
205 #if defined(KOKKOS_ENABLE_CXX17) 206 #define KOKKOS_IMPL_DEFINE_TRAIT(TRAIT) \ 208 struct TRAIT : Impl::TRAIT##_helper<T> {}; \ 210 inline constexpr auto TRAIT##_v = TRAIT<T>::value; 212 #define KOKKOS_IMPL_DEFINE_TRAIT(TRAIT) \ 214 struct TRAIT : Impl::TRAIT##_helper<T> {}; 218 KOKKOS_IMPL_DEFINE_TRAIT(infinity)
219 KOKKOS_IMPL_DEFINE_TRAIT(finite_min)
220 KOKKOS_IMPL_DEFINE_TRAIT(finite_max)
221 KOKKOS_IMPL_DEFINE_TRAIT(epsilon)
222 KOKKOS_IMPL_DEFINE_TRAIT(round_error)
223 KOKKOS_IMPL_DEFINE_TRAIT(norm_min)
226 KOKKOS_IMPL_DEFINE_TRAIT(digits)
227 KOKKOS_IMPL_DEFINE_TRAIT(digits10)
228 KOKKOS_IMPL_DEFINE_TRAIT(max_digits10)
229 KOKKOS_IMPL_DEFINE_TRAIT(radix)
230 KOKKOS_IMPL_DEFINE_TRAIT(min_exponent)
231 KOKKOS_IMPL_DEFINE_TRAIT(min_exponent10)
232 KOKKOS_IMPL_DEFINE_TRAIT(max_exponent)
233 KOKKOS_IMPL_DEFINE_TRAIT(max_exponent10)
235 #undef KOKKOS_IMPL_DEFINE_TRAIT 240 struct reduction_identity;
266 struct reduction_identity<signed char> {
267 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char sum() {
268 return static_cast<signed char>(0);
270 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char prod() {
271 return static_cast<signed char>(1);
273 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char max() {
276 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char min() {
279 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char bor() {
280 return static_cast<signed char>(0x0);
282 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char band() {
283 return ~static_cast<
signed char>(0x0);
285 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char lor() {
286 return static_cast<signed char>(0);
288 KOKKOS_FORCEINLINE_FUNCTION constexpr
static signed char land() {
289 return static_cast<signed char>(1);
294 struct reduction_identity<short> {
295 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short sum() {
296 return static_cast<short>(0);
298 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short prod() {
299 return static_cast<short>(1);
301 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short max() {
return SHRT_MIN; }
302 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short min() {
return SHRT_MAX; }
303 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short bor() {
304 return static_cast<short>(0x0);
306 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short band() {
307 return ~static_cast<
short>(0x0);
309 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short lor() {
310 return static_cast<short>(0);
312 KOKKOS_FORCEINLINE_FUNCTION constexpr
static short land() {
313 return static_cast<short>(1);
318 struct reduction_identity<int> {
319 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int sum() {
320 return static_cast<int>(0);
322 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int prod() {
323 return static_cast<int>(1);
325 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int max() {
return INT_MIN; }
326 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int min() {
return INT_MAX; }
327 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int bor() {
328 return static_cast<int>(0x0);
330 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int band() {
331 return ~static_cast<
int>(0x0);
333 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int lor() {
334 return static_cast<int>(0);
336 KOKKOS_FORCEINLINE_FUNCTION constexpr
static int land() {
337 return static_cast<int>(1);
342 struct reduction_identity<long> {
343 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long sum() {
344 return static_cast<long>(0);
346 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long prod() {
347 return static_cast<long>(1);
349 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long max() {
return LONG_MIN; }
350 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long min() {
return LONG_MAX; }
351 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long bor() {
352 return static_cast<long>(0x0);
354 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long band() {
355 return ~static_cast<
long>(0x0);
357 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long lor() {
358 return static_cast<long>(0);
360 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long land() {
361 return static_cast<long>(1);
366 struct reduction_identity<long long> {
367 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long sum() {
368 return static_cast<long long>(0);
370 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long prod() {
371 return static_cast<long long>(1);
373 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long max() {
376 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long min() {
379 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long bor() {
380 return static_cast<long long>(0x0);
382 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long band() {
383 return ~static_cast<
long long>(0x0);
385 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long lor() {
386 return static_cast<long long>(0);
388 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long long land() {
389 return static_cast<long long>(1);
394 struct reduction_identity<unsigned char> {
395 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char sum() {
396 return static_cast<unsigned char>(0);
398 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char prod() {
399 return static_cast<unsigned char>(1);
401 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char max() {
402 return static_cast<unsigned char>(0);
404 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char min() {
407 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char bor() {
408 return static_cast<unsigned char>(0x0);
410 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char band() {
411 return ~static_cast<
unsigned char>(0x0);
413 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char lor() {
414 return static_cast<unsigned char>(0);
416 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned char land() {
417 return static_cast<unsigned char>(1);
422 struct reduction_identity<unsigned short> {
423 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short sum() {
424 return static_cast<unsigned short>(0);
426 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short prod() {
427 return static_cast<unsigned short>(1);
429 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short max() {
430 return static_cast<unsigned short>(0);
432 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short min() {
435 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short bor() {
436 return static_cast<unsigned short>(0x0);
438 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short band() {
439 return ~static_cast<
unsigned short>(0x0);
441 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short lor() {
442 return static_cast<unsigned short>(0);
444 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned short land() {
445 return static_cast<unsigned short>(1);
450 struct reduction_identity<unsigned int> {
451 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int sum() {
452 return static_cast<unsigned int>(0);
454 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int prod() {
455 return static_cast<unsigned int>(1);
457 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int max() {
458 return static_cast<unsigned int>(0);
460 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int min() {
463 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int bor() {
464 return static_cast<unsigned int>(0x0);
466 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int band() {
467 return ~static_cast<
unsigned int>(0x0);
469 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int lor() {
470 return static_cast<unsigned int>(0);
472 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned int land() {
473 return static_cast<unsigned int>(1);
478 struct reduction_identity<unsigned long> {
479 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long sum() {
480 return static_cast<unsigned long>(0);
482 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long prod() {
483 return static_cast<unsigned long>(1);
485 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long max() {
486 return static_cast<unsigned long>(0);
488 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long min() {
491 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long bor() {
492 return static_cast<unsigned long>(0x0);
494 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long band() {
495 return ~static_cast<
unsigned long>(0x0);
497 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long lor() {
498 return static_cast<unsigned long>(0);
500 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long land() {
501 return static_cast<unsigned long>(1);
506 struct reduction_identity<unsigned long long> {
507 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long sum() {
508 return static_cast<unsigned long long>(0);
510 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long prod() {
511 return static_cast<unsigned long long>(1);
513 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long max() {
514 return static_cast<unsigned long long>(0);
516 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long min() {
519 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long bor() {
520 return static_cast<unsigned long long>(0x0);
522 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long band() {
523 return ~static_cast<
unsigned long long>(0x0);
525 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long lor() {
526 return static_cast<unsigned long long>(0);
528 KOKKOS_FORCEINLINE_FUNCTION constexpr
static unsigned long long land() {
529 return static_cast<unsigned long long>(1);
534 struct reduction_identity<float> {
535 KOKKOS_FORCEINLINE_FUNCTION constexpr
static float sum() {
536 return static_cast<float>(0.0f);
538 KOKKOS_FORCEINLINE_FUNCTION constexpr
static float prod() {
539 return static_cast<float>(1.0f);
541 KOKKOS_FORCEINLINE_FUNCTION constexpr
static float max() {
return -FLT_MAX; }
542 KOKKOS_FORCEINLINE_FUNCTION constexpr
static float min() {
return FLT_MAX; }
546 struct reduction_identity<double> {
547 KOKKOS_FORCEINLINE_FUNCTION constexpr
static double sum() {
548 return static_cast<double>(0.0);
550 KOKKOS_FORCEINLINE_FUNCTION constexpr
static double prod() {
551 return static_cast<double>(1.0);
553 KOKKOS_FORCEINLINE_FUNCTION constexpr
static double max() {
return -DBL_MAX; }
554 KOKKOS_FORCEINLINE_FUNCTION constexpr
static double min() {
return DBL_MAX; }
557 #if !defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) && \ 558 !defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU) 560 struct reduction_identity<long double> {
561 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long double sum() {
562 return static_cast<long double>(0.0);
564 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long double prod() {
565 return static_cast<long double>(1.0);
567 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long double max() {
570 KOKKOS_FORCEINLINE_FUNCTION constexpr
static long double min() {