16 #include <type_traits>
46 std::uint64_t
const seed = 0,
47 std::uint64_t
const subsequence = 0,
48 std::uint64_t
const offset = 0)
49 : engineVariant(seed, subsequence,
offset)
69 return engineVariant();
100 std::uint32_t
const seed = 0,
101 std::uint32_t
const subsequence = 0,
102 std::uint32_t
const offset = 0)
103 : engineVariant(seed, subsequence,
offset)
107 template<
typename TScalar>
111 using ResultVec = decltype(std::declval<EngineVariant>()());
125 return engineVariant();
134 template<
typename TEngine>
144 template<
typename TResult,
typename TSfinae =
void>
147 template<
typename TRes,
typename TEnable =
void>
153 template<
typename TRes>
154 struct ResultType<TRes, std::enable_if_t<meta::IsArrayOrVector<TRes>::value>>
156 using type =
typename TRes::value_type;
159 using T =
typename ResultType<TResult>::type;
160 static_assert(std::is_floating_point_v<T>,
"Only floating-point types are supported");
171 template<
typename TEngine>
176 auto result = engine();
177 T scale =
static_cast<T
>(1) /
static_cast<T
>(engine.max()) * _range;
179 static_cast<T
>(result[0]) * scale + _min,
180 static_cast<T
>(result[1]) * scale + _min,
181 static_cast<T
>(result[2]) * scale + _min,
182 static_cast<T
>(result[3]) * scale + _min};
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
constexpr ALPAKA_FN_HOST_ACC auto min() -> ResultInt
typename EngineVariant::template ResultContainer< TScalar > ResultContainer
ALPAKA_FN_HOST_ACC Philox4x32x10Vector(std::uint32_t const seed=0, std::uint32_t const subsequence=0, std::uint32_t const offset=0)
constexpr ALPAKA_FN_HOST_ACC auto max() -> ResultInt
decltype(std::declval< EngineVariant >()()) ResultVec
engine::PhiloxVector< EngineParams > EngineVariant
ALPAKA_FN_HOST_ACC auto operator()() -> ResultVec
std::uint32_t result_type
constexpr ALPAKA_FN_HOST_ACC auto max() -> result_type
ALPAKA_FN_HOST_ACC Philox4x32x10(std::uint64_t const seed=0, std::uint64_t const subsequence=0, std::uint64_t const offset=0)
ALPAKA_FN_HOST_ACC auto operator()() -> result_type
constexpr ALPAKA_FN_HOST_ACC auto min() -> result_type
engine::PhiloxSingle< EngineParams > EngineVariant
Engine outputs a single number.
#define ALPAKA_FN_HOST_ACC
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...
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
ALPAKA_FN_HOST_ACC auto operator()(TEngine &engine) -> decltype(engine())