diff options
-rw-r--r-- | arm_compute/core/CL/CLHelpers.h | 19 | ||||
-rw-r--r-- | src/core/CL/CLHelpers.cpp | 11 |
2 files changed, 29 insertions, 1 deletions
diff --git a/arm_compute/core/CL/CLHelpers.h b/arm_compute/core/CL/CLHelpers.h index a162b1c118..20d93df5a1 100644 --- a/arm_compute/core/CL/CLHelpers.h +++ b/arm_compute/core/CL/CLHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2022 Arm Limited. + * Copyright (c) 2016-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -267,5 +267,22 @@ void set_unroll_with_pragma(CLBuildOptions &built_opts, std::initializer_list<in * @return True if the extension is supported */ bool arm_matrix_multiply_supported(const cl::Device &device); + +/** Check whether cl_khr_command_buffer extension is supported by the specified CL device. + * + * @param[in] device The CL device + * + * @return True if the extension is supported by the CL device. + */ +bool command_buffer_supported(const cl::Device &device); + +/** Check whether cl_khr_command_buffer_mutable_dispatch extension is supported by the specified CL device. + * + * @param[in] device The CL device + * + * @return True if the extension is supported by the CL device. + */ +bool command_buffer_mutable_dispatch_supported(const cl::Device &device); + } // namespace arm_compute #endif /* ARM_COMPUTE_CLHELPERS_H */ diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index a32bcca655..78f36100d5 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -495,4 +495,15 @@ bool arm_matrix_multiply_supported(const cl::Device &device) { return device_supports_extension(device, "cl_arm_matrix_multiply"); } + +bool command_buffer_supported(const cl::Device &device) +{ + return device_supports_extension(device, "cl_khr_command_buffer"); +} + +bool command_buffer_mutable_dispatch_supported(const cl::Device &device) +{ + return device_supports_extension(device, "cl_khr_command_buffer_mutable_dispatch"); +} + } // namespace arm_compute |