| 120 | bool g_cuda_error = false; |
| 121 | |
| 122 | bool ck(cudaError_t e, const char* what) { |
| 123 | if (e == cudaSuccess) return true; |
| 124 | std::printf("CUDA: %s: %s\n", what, cudaGetErrorString(e)); |
| 125 | g_cuda_error = true; |
| 126 | return false; |
| 127 | } |
| 128 | |
| 129 | uint16_t sane_half(std::mt19937& rng) { // a finite fp16 of magnitude ~2^-10 .. 2^-6 |
| 130 | const uint32_t r = rng(); |
no test coverage detected