| 160 | } |
| 161 | |
| 162 | Result<std::shared_ptr<CudaIpcMemHandle>> ExportIpcBuffer(const void* data, |
| 163 | int64_t size) { |
| 164 | CUipcMemHandle cu_handle; |
| 165 | if (size > 0) { |
| 166 | ContextSaver set_temporary(context_); |
| 167 | CU_RETURN_NOT_OK( |
| 168 | "cuIpcGetMemHandle", |
| 169 | cuIpcGetMemHandle(&cu_handle, reinterpret_cast<CUdeviceptr>(data))); |
| 170 | } |
| 171 | return std::shared_ptr<CudaIpcMemHandle>(new CudaIpcMemHandle(size, &cu_handle)); |
| 172 | } |
| 173 | |
| 174 | Status OpenIpcBuffer(const CudaIpcMemHandle& ipc_handle, uint8_t** out) { |
| 175 | int64_t size = ipc_handle.memory_size(); |
nothing calls this directly
no outgoing calls
no test coverage detected