Skip to content

Commit c3b8c1d

Browse files
committed
dbk: nms fix arg checking and change linking
1 parent 8f93b32 commit c3b8c1d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

lib/CL/clSetKernelArg.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ pocl_verify_dbk_kernel_args (cl_mem buf,
227227
switch (arg_index)
228228
{
229229
case 0:
230+
return (buf->size >= attrs->num_boxes * sizeof (cl_uint) * 4)
231+
? CL_SUCCESS
232+
: CL_INVALID_ARG_VALUE;
230233
case 1:
231-
return ((attrs->num_boxes > 0)
232-
&& buf->size >= attrs->num_boxes * sizeof (cl_uint) * 4)
234+
return (buf->size >= attrs->num_boxes * sizeof (cl_float))
233235
? CL_SUCCESS
234236
: CL_INVALID_ARG_VALUE;
235237
case 2:

lib/CL/devices/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ if(HAVE_ONNXRT)
223223
target_link_libraries("pocl-devices" PRIVATE onnxruntime::onnxruntime)
224224
endif ()
225225
if(HAVE_OPENCV)
226-
target_link_libraries("pocl-devices" PRIVATE pocl_dbk_khr_dnn_utils opencv_dnn)
226+
add_dependencies("pocl-devices" pocl_dbk_khr_dnn_utils)
227+
target_link_libraries("pocl-devices" PRIVATE $<TARGET_OBJECTS:pocl_dbk_khr_dnn_utils> opencv_dnn)
227228
endif ()
228229

229230
set(POCL_DEVICES_OBJS "${POCL_DEVICES_OBJS}"

lib/CL/devices/cpu_dbk/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ list(APPEND POCL_DEVICES_SOURCES
1616
)
1717

1818
if(HAVE_OPENCV)
19-
add_library(pocl_dbk_khr_dnn_utils STATIC
20-
${CMAKE_CURRENT_SOURCE_DIR}/pocl_dbk_khr_dnn_utils.cpp
21-
${CMAKE_CURRENT_SOURCE_DIR}/pocl_dbk_khr_dnn_utils.hh)
19+
add_library(pocl_dbk_khr_dnn_utils OBJECT
20+
pocl_dbk_khr_dnn_utils.cpp
21+
pocl_dbk_khr_dnn_utils.hh)
2222
target_link_libraries(pocl_dbk_khr_dnn_utils PRIVATE opencv_dnn)
2323

2424
list(APPEND POCL_DEVICES_LINK_LIST pocl_dbk_khr_dnn_utils)

0 commit comments

Comments
 (0)