| 850 | |
| 851 | template<typename T> |
| 852 | __global__ void uniformThreefry(T *out, uint hi, uint lo, uint hic, uint loc, |
| 853 | uint elementsPerBlock, uint elements) { |
| 854 | uint index = blockIdx.x * elementsPerBlock + threadIdx.x; |
| 855 | uint key[2] = {lo, hi}; |
| 856 | uint ctr[2] = {loc, hic}; |
| 857 | ctr[0] += index; |
| 858 | ctr[1] += (ctr[0] < loc); |
| 859 | uint o[4]; |
| 860 | |
| 861 | threefry(key, ctr, o); |
| 862 | uint step = elementsPerBlock / 2; |
| 863 | ctr[0] += step; |
| 864 | ctr[1] += (ctr[0] < step); |
| 865 | threefry(key, ctr, o + 2); |
| 866 | |
| 867 | if (blockIdx.x != (gridDim.x - 1)) { |
| 868 | writeOut128Bytes(out, index, o[0], o[1], o[2], o[3]); |
| 869 | } else { |
| 870 | partialWriteOut128Bytes(out, index, o[0], o[1], o[2], o[3], elements); |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | template<typename T> |
| 875 | __global__ void uniformMersenne(T *const out, uint *const gState, |
nothing calls this directly
no test coverage detected