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

Function GetDeviceAddress

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

Source from the content-addressed store, hash-verified

468}
469
470Result<uintptr_t> GetDeviceAddress(const uint8_t* cpu_data,
471 const std::shared_ptr<CudaContext>& ctx) {
472 ContextSaver context_saver(*ctx);
473 CUdeviceptr ptr;
474 // XXX should we use cuPointerGetAttribute(CU_POINTER_ATTRIBUTE_DEVICE_POINTER)
475 // instead?
476 CU_RETURN_NOT_OK("cuMemHostGetDevicePointer",
477 cuMemHostGetDevicePointer(&ptr, const_cast<uint8_t*>(cpu_data), 0));
478 return static_cast<uintptr_t>(ptr);
479}
480
481Result<uint8_t*> GetHostAddress(uintptr_t device_ptr) {
482 void* ptr;

Callers 2

GetDeviceAddressMethod · 0.85
GetDeviceAddressMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected