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

Function normalPhilox

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

Source from the content-addressed store, hash-verified

930
931template<typename T>
932__global__ void normalPhilox(T *out, uint hi, uint lo, uint hic, uint loc,
933 uint elementsPerBlock, uint elements) {
934 uint index = blockIdx.x * elementsPerBlock + threadIdx.x;
935 uint key[2] = {lo, hi};
936 uint ctr[4] = {loc, hic, 0, 0};
937 ctr[0] += index;
938 ctr[1] += (ctr[0] < loc);
939 ctr[2] += (ctr[1] < hic);
940
941 philox(key, ctr);
942
943 if (blockIdx.x != (gridDim.x - 1)) {
944 boxMullerWriteOut128Bytes(out, index, ctr[0], ctr[1], ctr[2], ctr[3]);
945 } else {
946 partialBoxMullerWriteOut128Bytes(out, index, ctr[0], ctr[1], ctr[2],
947 ctr[3], elements);
948 }
949}
950
951template<typename T>
952__global__ void normalThreefry(T *out, uint hi, uint lo, uint hic, uint loc,

Callers

nothing calls this directly

Calls 3

philoxFunction · 0.70

Tested by

no test coverage detected