MCPcopy Create free account
hub / github.com/a2flo/floor / create_queue

Method create_queue

compute/cuda/cuda_compute.cpp:397–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397shared_ptr<compute_queue> cuda_compute::create_queue(const compute_device& dev) const {
398 // ensure context is set for the calling thread
399 const auto& cuda_dev = (const cuda_device&)dev;
400 if (cuda_dev.ctx != nullptr) {
401 CU_CALL_RET(cu_ctx_set_current(cuda_dev.ctx),
402 "failed to make cuda context current", {})
403 }
404
405 cu_stream stream;
406 CU_CALL_RET(cu_stream_create(&stream, CU_STREAM_FLAGS::NON_BLOCKING),
407 "failed to create cuda stream", {})
408
409 auto ret = make_shared<cuda_queue>(dev, stream);
410 queues.push_back(ret);
411 return ret;
412}
413
414const compute_queue* cuda_compute::get_device_default_queue(const compute_device& dev) const {
415 const auto def_queue = default_queues.get(dev);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected