MCPcopy Create free account
hub / github.com/apache/arrow / AllocateHostBuffer

Method AllocateHostBuffer

cpp/src/arrow/gpu/cuda_context.cc:262–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262Result<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
271bool IsCudaDevice(const Device& device) {
272 return device.type_name() == kCudaDeviceTypeName;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected