diff --git a/README.md b/README.md index e513b6ba..6b1f05bc 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/src/api.cpp b/src/api.cpp index de032465..17544e8d 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -1467,6 +1467,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( icd_downcast(context), icd_downcast(device), properties, std::move(properties_array)); diff --git a/src/config.def b/src/config.def index 839bdd88..e9e5db31 100644 --- a/src/config.def +++ b/src/config.def @@ -50,6 +50,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)