MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / uniformPhilox

Function uniformPhilox

src/backend/cuda/kernel/random_engine.hpp:833–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831
832template<typename T>
833__global__ void uniformPhilox(T *out, uint hi, uint lo, uint hic, uint loc,
834 uint elementsPerBlock, uint elements) {
835 uint index = blockIdx.x * elementsPerBlock + threadIdx.x;
836 uint key[2] = {lo, hi};
837 uint ctr[4] = {loc, hic, 0, 0};
838 ctr[0] += index;
839 ctr[1] += (ctr[0] < loc);
840 ctr[2] += (ctr[1] < hic);
841 if (blockIdx.x != (gridDim.x - 1)) {
842 philox(key, ctr);
843 writeOut128Bytes(out, index, ctr[0], ctr[1], ctr[2], ctr[3]);
844 } else {
845 philox(key, ctr);
846 partialWriteOut128Bytes(out, index, ctr[0], ctr[1], ctr[2], ctr[3],
847 elements);
848 }
849}
850
851template<typename T>
852__global__ void uniformThreefry(T *out, uint hi, uint lo, uint hic, uint loc,

Callers

nothing calls this directly

Calls 3

philoxFunction · 0.70
writeOut128BytesFunction · 0.70
partialWriteOut128BytesFunction · 0.70

Tested by

no test coverage detected