| 35 | |
| 36 | template <typename T> |
| 37 | T* up(const std::vector<T>& h) { |
| 38 | void* p = nullptr; |
| 39 | check(cudaMalloc(&p, h.size() * sizeof(T) + 64), "malloc"); |
| 40 | check(cudaMemcpy(p, h.data(), h.size() * sizeof(T), cudaMemcpyHostToDevice), "h2d"); |
| 41 | return (T*) p; |
| 42 | } |
| 43 | template <typename T> |
| 44 | std::vector<T> down(const T* d, size_t n) { |
| 45 | std::vector<T> h(n); |
no test coverage detected