Skip to content

Commit

Permalink
Give appropriate errors for out of order execution related props (#713)
Browse files Browse the repository at this point in the history
* Give appropriate errors for out of order execution related props

* Add CLVK_IGNORE_OUT_OF_ORDER_EXECUTION flag to control OOOE

* edit readme

* edit readme

* enable the use of config file options

* use bool instead of uint

* Update README.md

Co-authored-by: Romaric Jodin <[email protected]>

* use func instead of val

Co-authored-by: Romaric Jodin <[email protected]>

* fix format

* use bool instead of uint

Co-authored-by: Romaric Jodin <[email protected]>

* get rid of unneeded code

* revert untouched code

* get rid of set

* fix format

Co-authored-by: Romaric Jodin <[email protected]>

* fix format

* revert untouched code

* fix oooe condition

* Update README.md

* Update README.md

---------

Co-authored-by: Romaric Jodin <[email protected]>
Co-authored-by: Kévin Petit <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2024
1 parent 35577d1 commit 99c68d1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ using the name of the corresponding environment variable.

* `CLVK_CONFIG_FILE` specifies the path to an additional configuration file.

* `CLVK_IGNORE_OUT_OF_ORDER_EXECUTION` controls whether out-of-order queues can be
created. Out-of-order queues, when allowed, always behave as in-order queues. This can be
useful to enable applications that request out-of-order queues but don't use all their features
to run.

* 0: creating an out-of-order queue results in a failure (default)
* 1: creating an out-of-order queue is supported but it will function as an in-order queue

* `CLVK_LOG` controls the level of logging

* 0: only print fatal messages (default)
Expand Down
7 changes: 7 additions & 0 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1486,6 +1486,13 @@ cvk_create_command_queue(cl_context context, cl_device_id device,
return nullptr;
}

if (!config.ignore_out_of_order_execution()) {
// We do not support out of order command queues so this must fail
if (properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
*errcode_ret = CL_INVALID_QUEUE_PROPERTIES;
return nullptr;
}
}
auto queue = std::make_unique<cvk_command_queue>(
icd_downcast(context), icd_downcast(device), properties,
std::move(properties_array));
Expand Down
1 change: 1 addition & 0 deletions src/config.def
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ OPTION(uint32_t, max_cmd_batch_size, 10000u)
OPTION(uint32_t, max_first_cmd_batch_size, 10000u)
OPTION(uint32_t, max_cmd_group_size, UINT32_MAX)
OPTION(uint32_t, max_first_cmd_group_size, UINT32_MAX)
OPTION(bool, ignore_out_of_order_execution, false) // false meaning dont ignore

// experimental
OPTION(bool, dynamic_batches, false)
Expand Down

0 comments on commit 99c68d1

Please sign in to comment.