MCPcopy Create free account
hub / github.com/XpuOS/xsched / OnHwCommandSubmit

Method OnHwCommandSubmit

platforms/cuda/hal/src/level2/cuda_queue.cpp:49–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void CudaQueueLv2::OnHwCommandSubmit(std::shared_ptr<preempt::HwCommand> hw_cmd)
50{
51 this->CudaQueueLv1::OnHwCommandSubmit(hw_cmd);
52 if (level_ < kPreemptLevelDeactivate) return;
53
54 if (std::dynamic_pointer_cast<CudaGraphCommand>(hw_cmd) != nullptr) {
55 // do nothing here, will automatically fallback to wait-based preemption
56 static bool warned = false;
57 if (!warned) {
58 warned = true;
59 XWARN("CUDA graph cannot support level-2 preemption, falling back to level-1");
60 }
61 return;
62 }
63 auto kernel = std::dynamic_pointer_cast<CudaKernelCommand>(hw_cmd);
64 if (kernel != nullptr) instrument_manager_->Instrument(kernel);
65}
66
67CUresult CudaQueueLv2::DirectLaunch(std::shared_ptr<CudaKernelCommand> kernel,
68 CUcontext ctx, CUstream stream)

Callers

nothing calls this directly

Calls 1

InstrumentMethod · 0.45

Tested by

no test coverage detected