From 3a676f4e342c3a4c556918e807873a2bba171840 Mon Sep 17 00:00:00 2001 From: Syed Faaiz Hussain Date: Tue, 27 Aug 2024 11:49:22 -0700 Subject: [PATCH] enable the use of config file options --- src/api.cpp | 6 ++---- src/config.def | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/api.cpp b/src/api.cpp index 7041f25b..2decdedb 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -1477,10 +1477,8 @@ cvk_create_command_queue(cl_context context, cl_device_id device, } cl_int err = CL_SUCCESS; - std::string oooe_env_var = "CLVK_IGNORE_OUT_OF_ORDER_EXECUTION"; - const char* oooe_env_var_val = getenv(oooe_env_var.c_str()); - - if (oooe_env_var_val == nullptr || strcmp(oooe_env_var_val, "1") != 0) { + if (!config.ignore_out_of_order_execution.set || + config.ignore_out_of_order_execution.value == 0) { // We do not support out of order command queues so this must fail if (properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE && !out_of_order_device_support(device, err)) { diff --git a/src/config.def b/src/config.def index d81989e0..c66b37bf 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(uint32_t, ignore_out_of_order_execution, 0u) // 0 meaning dont ignore // experimental OPTION(bool, dynamic_batches, false)