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

Method MakeStream

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

Source from the content-addressed store, hash-verified

273}
274
275Result<std::shared_ptr<Device::Stream>> CudaDevice::MakeStream(unsigned int flags) {
276 ARROW_ASSIGN_OR_RAISE(auto context, GetContext());
277 ContextSaver set_temporary(reinterpret_cast<CUcontext>(context.get()->handle()));
278
279 CUstream stream;
280 CU_RETURN_NOT_OK("cuStreamCreate", cuStreamCreate(&stream, flags));
281 return std::shared_ptr<Device::Stream>(
282 new CudaDevice::Stream(context, new CUstream(stream), [](void* st) {
283 auto typed_stream = reinterpret_cast<CUstream*>(st);
284 // DCHECK_OK still evaluates its argument in release mode
285 // but in debug mode it'll also throw if it fails
286 DCHECK_OK(
287 internal::StatusFromCuda(cuStreamDestroy(*typed_stream), "cuStreamDestroy"));
288 delete typed_stream;
289 }));
290}
291
292Result<std::shared_ptr<Device::Stream>> CudaDevice::WrapStream(
293 void* stream, Device::Stream::release_fn_t release_fn) {

Callers

nothing calls this directly

Calls 3

StatusFromCudaFunction · 0.85
handleMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected