| 308 | |
| 309 | template <class DType> |
| 310 | DType* alloc_gpu_tensor(std::vector<int> shape) { |
| 311 | DType* dt; |
| 312 | CUDA_CHECK(cudaMalloc( |
| 313 | (void**)&dt, |
| 314 | std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()) * |
| 315 | sizeof(DType))); |
| 316 | return dt; |
| 317 | } |
| 318 | |
| 319 | template <class DType> |
| 320 | void free_cpu_tensor(DType* ptr) { |
nothing calls this directly
no outgoing calls
no test coverage detected