Skip to content

Commit 26b1620

Browse files
[hw path][fix] Return correct status code when using NUMA node with no devices (#788)
Co-authored-by: Meng Cao <[email protected]>
1 parent bc17064 commit 26b1620

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sources/core-iaa/sources/accelerator/enqueue.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "dispatcher/numa.hpp"
1616

1717
extern "C" hw_accelerator_status hw_enqueue_descriptor(void *desc_ptr, int32_t device_numa_id) {
18-
hw_accelerator_status result = HW_ACCELERATOR_NOT_SUPPORTED_BY_WQ;
18+
hw_accelerator_status result = HW_ACCELERATOR_WORK_QUEUES_NOT_AVAILABLE;
1919

2020
#if defined( __linux__ )
2121
static auto &dispatcher = qpl::ml::dispatcher::hw_dispatcher::get_instance();
@@ -54,7 +54,9 @@ extern "C" hw_accelerator_status hw_enqueue_descriptor(void *desc_ptr, int32_t d
5454
hw_iaa_descriptor_hint_cpu_cache_as_destination((hw_descriptor *) desc_ptr, device.get_cache_write_available());
5555

5656
hw_accelerator_status enqueue_result = device.enqueue_descriptor(desc_ptr);
57-
if (enqueue_result == HW_ACCELERATOR_WQ_IS_BUSY) {
57+
if (enqueue_result == HW_ACCELERATOR_NOT_SUPPORTED_BY_WQ && result == HW_ACCELERATOR_WORK_QUEUES_NOT_AVAILABLE) {
58+
result = HW_ACCELERATOR_NOT_SUPPORTED_BY_WQ;
59+
} else if (enqueue_result == HW_ACCELERATOR_WQ_IS_BUSY) {
5860
result = HW_ACCELERATOR_WQ_IS_BUSY;
5961
} else if (enqueue_result == HW_ACCELERATOR_STATUS_OK) {
6062
result = HW_ACCELERATOR_STATUS_OK;

0 commit comments

Comments
 (0)