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

Function GetDeviceAddress

cpp/src/arrow/gpu/cuda_memory.cc:480–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480Result<uintptr_t> GetDeviceAddress(const uint8_t* cpu_data,
481 const std::shared_ptr<CudaContext>& ctx) {
482 ContextSaver context_saver(*ctx);
483 CUdeviceptr ptr;
484 // XXX should we use cuPointerGetAttribute(CU_POINTER_ATTRIBUTE_DEVICE_POINTER)
485 // instead?
486 CU_RETURN_NOT_OK("cuMemHostGetDevicePointer",
487 cuMemHostGetDevicePointer(&ptr, const_cast<uint8_t*>(cpu_data), 0));
488 return static_cast<uintptr_t>(ptr);
489}
490
491Result<uint8_t*> GetHostAddress(uintptr_t device_ptr) {
492 void* ptr;

Callers 2

GetDeviceAddressMethod · 0.85
GetDeviceAddressMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected