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

Method Serialize

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

Source from the content-addressed store, hash-verified

78}
79
80Result<std::shared_ptr<Buffer>> CudaIpcMemHandle::Serialize(MemoryPool* pool) const {
81 int64_t size = impl_->memory_size;
82 const size_t handle_size =
83 (size > 0 ? sizeof(int64_t) + sizeof(CUipcMemHandle) : sizeof(int64_t));
84
85 ARROW_ASSIGN_OR_RAISE(auto buffer,
86 AllocateBuffer(static_cast<int64_t>(handle_size), pool));
87 memcpy(buffer->mutable_data(), &impl_->memory_size, sizeof(impl_->memory_size));
88 if (size > 0) {
89 memcpy(buffer->mutable_data() + sizeof(impl_->memory_size), &impl_->ipc_handle,
90 sizeof(impl_->ipc_handle));
91 }
92 return buffer;
93}
94
95const void* CudaIpcMemHandle::handle() const { return &impl_->ipc_handle; }
96

Callers 1

TEST_FFunction · 0.45

Calls 1

mutable_dataMethod · 0.45

Tested by 1

TEST_FFunction · 0.36