| 260 | } |
| 261 | |
| 262 | Result<std::shared_ptr<CudaHostBuffer>> CudaDevice::AllocateHostBuffer(int64_t size) { |
| 263 | ARROW_ASSIGN_OR_RAISE(auto context, GetContext()); |
| 264 | ContextSaver set_temporary(*context); |
| 265 | void* ptr; |
| 266 | CU_RETURN_NOT_OK("cuMemHostAlloc", cuMemHostAlloc(&ptr, static_cast<size_t>(size), |
| 267 | CU_MEMHOSTALLOC_PORTABLE)); |
| 268 | return std::make_shared<CudaHostBuffer>(reinterpret_cast<uint8_t*>(ptr), size); |
| 269 | } |
| 270 | |
| 271 | bool IsCudaDevice(const Device& device) { |
| 272 | return device.type_name() == kCudaDeviceTypeName; |
nothing calls this directly
no outgoing calls
no test coverage detected