| 27 | |
| 28 | namespace { |
| 29 | void ck(cudaError_t e, const char* w) { |
| 30 | if (e != cudaSuccess) { std::fprintf(stderr, "%s: %s\n", w, cudaGetErrorString(e)); std::exit(2); } |
| 31 | } |
| 32 | template <typename T> T* up(const std::vector<T>& h) { |
| 33 | T* d = nullptr; |
| 34 | ck(cudaMalloc(&d, h.size() * sizeof(T) + 64), "malloc"); |
no test coverage detected