| 287 | } |
| 288 | |
| 289 | EXPORT_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 | |
| 311 | EXPORT_C_FUNC XResult XQueueSubmit(XQueueHandle xq, HwCommandHandle hw_cmd) |
| 312 | { |
no test coverage detected