22 template<
unsigned TCounterSize,
unsigned TW
idth,
unsigned TRounds>
26 static constexpr
unsigned width = TWidth;
27 static constexpr
unsigned rounds = TRounds;
37 template<
typename TParams>
40 static constexpr
unsigned numRounds()
42 return TParams::rounds;
45 static constexpr
unsigned vectorSize()
47 return TParams::counterSize;
50 static constexpr
unsigned numberWidth()
52 return TParams::width;
55 static_assert(numRounds() > 0,
"Number of Philox rounds must be > 0.");
56 static_assert(vectorSize() % 2 == 0,
"Philox counter size must be an even number.");
57 static_assert(vectorSize() <= 16,
"Philox SP network is not specified for sizes > 16.");
58 static_assert(numberWidth() % 8 == 0,
"Philox number width in bits must be a multiple of 8.");
60 static_assert(numberWidth() == 32,
"Philox implemented only for 32 bit numbers.");
76 std::uint32_t H0, L0, H1, L1;
79 return Counter{H1 ^ counter[1] ^ key[0], L1, H0 ^ counter[3] ^ key[1], L0};
104 for(
unsigned int n = 0; n < numRounds(); ++n)
#define ALPAKA_UNROLL(...)
Suggests unrolling of the directly following loop to the compiler.
static constexpr std::uint32_t WEYL_32_0()
1st Weyl sequence parameter, 32 bits
static constexpr std::uint32_t MULTIPLITER_4x32_1()
Second Philox S-box multiplier.
static constexpr std::uint32_t WEYL_32_1()
2nd Weyl sequence parameter, 32 bits
static constexpr std::uint32_t MULTIPLITER_4x32_0()
First Philox S-box multiplier.
static ALPAKA_FN_HOST_ACC auto generate(Counter const &counter, Key const &key) -> Counter
static ALPAKA_FN_HOST_ACC auto nRounds(Counter const &counter_in, Key const &key_in) -> Counter
static ALPAKA_FN_HOST_ACC auto bumpKey(Key const &key)
static ALPAKA_FN_HOST_ACC auto singleRound(Counter const &counter, Key const &key)
#define ALPAKA_FN_HOST_ACC
The random number generator engine specifics.
constexpr ALPAKA_FN_HOST_ACC void multiplyAndSplit64to32(std::uint64_t const a, std::uint64_t const b, std::uint32_t &resultHigh, std::uint32_t &resultLow)
std::integral_constant< std::size_t, N > DimInt
static constexpr unsigned counterSize
static constexpr unsigned rounds
static constexpr unsigned width