| 72 | } |
| 73 | |
| 74 | ExternalBuffer::ExternalBuffer(DLPackTensor &&dlTensor) |
| 75 | { |
| 76 | if (!IsCudaAccessible(dlTensor->device.device_type)) |
| 77 | { |
| 78 | throw std::runtime_error("Only CUDA memory buffers can be wrapped"); |
| 79 | } |
| 80 | |
| 81 | if (dlTensor->data != nullptr) |
| 82 | { |
| 83 | CheckValidCUDABuffer(dlTensor->data); |
| 84 | } |
| 85 | |
| 86 | m_dlTensor = std::move(dlTensor); |
| 87 | } |
| 88 | |
| 89 | Shape ExternalBuffer::shape() const |
| 90 | { |
nothing calls this directly
no test coverage detected