| 449 | T* data() { return cu_buffer; } |
| 450 | uint64_t size() { return buf_size; } |
| 451 | void malloc(uint64_t size) { |
| 452 | buf_size = size; |
| 453 | CUDA_CHECK( |
| 454 | cudaMalloc(reinterpret_cast<void**>(&cu_buffer), size * sizeof(T))); |
| 455 | } |
| 456 | void free() { |
| 457 | if (cu_buffer != NULL) { |
| 458 | CUDA_CHECK(cudaFree(cu_buffer)); |
no outgoing calls