aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-08-11 17:48:54 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-08-15 10:58:50 +0000
commit48b6d17f8958c5bc9fa715853d227e430e3547e8 (patch)
treef8e71135b07793acefa6f359bf3c5cbc0d06a1ce
parent7d91c615b594d5e9abb1753b3f572f64b0581a48 (diff)
downloadComputeLibrary-48b6d17f8958c5bc9fa715853d227e430e3547e8.tar.gz
Check CL command buffer extension
* Add helper functions to check whether command buffer extensions exist in CL device. Resolves: COMPMID-6453 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ibc287e4526e54be4702241ab8ca0cea0b8661b3a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10130 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Anitha Raj <Anitha.Raj@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/core/CL/CLHelpers.h19
-rw-r--r--src/core/CL/CLHelpers.cpp11
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