259 template<
typename Tx,
typename Ty>
260 struct Max<
MaxStdLib, Tx, Ty,
std::enable_if_t<std::is_arithmetic_v<Tx> && std::is_arithmetic_v<Ty>>>
267 if constexpr(std::is_integral_v<Tx> && std::is_integral_v<Ty>)
270 is_decayed_v<Tx, float> || is_decayed_v<Ty, float> || is_decayed_v<Tx, double>
271 || is_decayed_v<Ty, double>)
274 static_assert(!
sizeof(Tx),
"Unsupported data type");
281 template<
typename Tx,
typename Ty>
282 struct Min<MinStdLib, Tx, Ty,
std::enable_if_t<std::is_arithmetic_v<Tx> && std::is_arithmetic_v<Ty>>>
289 if constexpr(std::is_integral_v<Tx> && std::is_integral_v<Ty>)
292 is_decayed_v<Tx, float> || is_decayed_v<Ty, float> || is_decayed_v<Tx, double>
293 || is_decayed_v<Ty, double>)
296 static_assert(!
sizeof(Tx),
"Unsupported data type");
304 template<
typename TArg>
305 struct Isfinite<IsfiniteStdLib, TArg,
std::enable_if_t<std::is_floating_point_v<TArg>>>
307 auto operator()(IsfiniteStdLib
const& , TArg
const&
arg) ->
bool
309 if constexpr(std::is_same_v<TArg, float>)
311 constexpr std::uint32_t expMask = 0x7F80'0000;
312 std::uint32_t bits = std::bit_cast<std::uint32_t>(
arg);
313 bool result = (bits & expMask) != expMask;
316 else if constexpr(std::is_same_v<TArg, double>)
318 constexpr std::uint64_t expMask = 0x7FF0'0000'0000'0000ULL;
319 std::uint64_t bits = std::bit_cast<std::uint64_t>(
arg);
320 bool result = (bits & expMask) != expMask;
325 static_assert(!
sizeof(TArg),
"Unsupported floating-point type");
333 template<
typename TArg>
334 struct Isinf<IsinfStdLib, TArg,
std::enable_if_t<std::is_floating_point_v<TArg>>>
336 auto operator()(IsinfStdLib
const& , TArg
const&
arg) ->
bool
338 if constexpr(std::is_same_v<TArg, float>)
340 constexpr std::uint32_t expMask = 0x7F80'0000;
341 constexpr std::uint32_t fracMask = 0x007F'FFFF;
342 std::uint32_t bits = std::bit_cast<std::uint32_t>(
arg);
343 bool result = ((bits & expMask) == expMask) && !(bits & fracMask);
346 else if constexpr(std::is_same_v<TArg, double>)
348 constexpr std::uint64_t expMask = 0x7FF0'0000'0000'0000ULL;
349 constexpr std::uint64_t fracMask = 0x000F'FFFF'FFFF'FFFFULL;
350 std::uint64_t bits = std::bit_cast<std::uint64_t>(
arg);
351 bool result = ((bits & expMask) == expMask) && !(bits & fracMask);
356 static_assert(!
sizeof(TArg),
"Unsupported floating-point type");
364 template<
typename TArg>
365 struct Isnan<IsnanStdLib, TArg,
std::enable_if_t<std::is_floating_point_v<TArg>>>
367 auto operator()(IsnanStdLib
const& , TArg
const&
arg) ->
bool
369 if constexpr(std::is_same_v<TArg, float>)
371 constexpr std::uint32_t expMask = 0x7F80'0000;
372 constexpr std::uint32_t fracMask = 0x007F'FFFF;
373 std::uint32_t bits = std::bit_cast<std::uint32_t>(
arg);
374 bool result = ((bits & expMask) == expMask) && (bits & fracMask);
377 else if constexpr(std::is_same_v<TArg, double>)
379 constexpr std::uint64_t expMask = 0x7FF0'0000'0000'0000ULL;
380 constexpr std::uint64_t fracMask = 0x000F'FFFF'FFFF'FFFFULL;
381 std::uint64_t bits = std::bit_cast<std::uint64_t>(
arg);
382 bool result = ((bits & expMask) == expMask) && (bits & fracMask);
387 static_assert(!
sizeof(TArg),
"Unsupported floating-point type");
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
The standard library abs, implementation covered by the general template.
The standard library acos, implementation covered by the general template.
The standard library acos, implementation covered by the general template.
The standard library arg, implementation covered by the general template.
The standard library asin, implementation covered by the general template.
The standard library asinh, implementation covered by the general template.
The standard library atan2, implementation covered by the general template.
The standard library atan, implementation covered by the general template.
The standard library atanh, implementation covered by the general template.
The standard library cbrt, implementation covered by the general template.
The standard library ceil, implementation covered by the general template.
The standard library conj, implementation covered by the general template.
The standard library copysign, implementation covered by the general template.
The standard library cos, implementation covered by the general template.
The standard library cosh, implementation covered by the general template.
The standard library erf, implementation covered by the general template.
The standard library exp, implementation covered by the general template.
The standard library floor, implementation covered by the general template.
The standard library fma, implementation covered by the general template.
The standard library fmod, implementation covered by the general template.
The standard library isfinite, implementation covered by the general template.
The standard library isinf, implementation covered by the general template.
The standard library isnan, implementation covered by the general template.
The standard library log10, implementation covered by the general template.
The standard library log2, implementation covered by the general template.
The standard library log, implementation covered by the general template.
The standard library math trait specializations.
The standard library max.
The standard library min.
The standard library pow, implementation covered by the general template.
The standard library remainder, implementation covered by the general template.
The standard library round, implementation covered by the general template.
The standard library rsqrt, implementation covered by the general template.
The standard library sincos, implementation covered by the general template.
The standard library sin, implementation covered by the general template.
The standard library sinh, implementation covered by the general template.
The standard library sqrt, implementation covered by the general template.
The standard library tan, implementation covered by the general template.
The standard library tanh, implementation covered by the general template.
The standard library trunc, implementation covered by the general template.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto max(T const &max_ctx, Tx const &x, Ty const &y)
Returns the larger of two arguments. NaNs are treated as missing data (between a NaN and a numeric va...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto min(T const &min_ctx, Tx const &x, Ty const &y)
Returns the smaller of two arguments. NaNs are treated as missing data (between a NaN and a numeric v...
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto arg(T const &arg_ctx, TArgument const &argument)
Computes the complex argument of the value.
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, TArg const &arg)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)
ALPAKA_FN_HOST_ACC auto operator()(T const &, Tx const &x, Ty const &y)