| 47 | } |
| 48 | |
| 49 | void 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 | |
| 67 | CUresult CudaQueueLv2::DirectLaunch(std::shared_ptr<CudaKernelCommand> kernel, |
| 68 | CUcontext ctx, CUstream stream) |
nothing calls this directly
no test coverage detected