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

Function XQueueSetLaunchConfig

preempt/src/xqueue/xqueue.cpp:289–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289EXPORT_C_FUNC XResult XQueueSetLaunchConfig(XQueueHandle xq, int64_t threshold, int64_t batch_size)
290{
291 std::shared_ptr<XQueue> xq_shptr = XQueueManager::Get(xq);
292 if (xq_shptr == nullptr) {
293 XWARN("XQueue with handle 0x" FMT_64X " does not exist", xq);
294 return kXSchedErrorNotFound;
295 }
296
297 if (threshold <= 0 && batch_size <= 0) return kXSchedSuccess;
298 if (threshold > 0 && !xq_shptr->GetFeatures(kQueueFeatureDynamicThreshold)) {
299 XWARN("XQueue with handle 0x" FMT_64X " does not support dynamic command threshold", xq);
300 return kXSchedErrorNotSupported;
301 }
302 if (batch_size > 0 && !xq_shptr->GetFeatures(kQueueFeatureDynamicBatchSize)) {
303 XWARN("XQueue with handle 0x" FMT_64X " does not support dynamic command batch size", xq);
304 return kXSchedErrorNotSupported;
305 }
306
307 xq_shptr->SetLaunchConfig(threshold, batch_size);
308 return kXSchedSuccess;
309}
310
311EXPORT_C_FUNC XResult XQueueSubmit(XQueueHandle xq, HwCommandHandle hw_cmd)
312{

Callers 2

AutoCreateMethod · 0.85

Calls 2

GetFeaturesMethod · 0.80
SetLaunchConfigMethod · 0.45

Tested by

no test coverage detected