aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm_compute/core/CL/CLKernelLibrary.h6
-rw-r--r--src/core/CL/CLKernelLibrary.cpp5
-rw-r--r--tests/benchmark_examples/RunExample.cpp10
-rw-r--r--tests/main.cpp10
4 files changed, 31 insertions, 0 deletions
diff --git a/arm_compute/core/CL/CLKernelLibrary.h b/arm_compute/core/CL/CLKernelLibrary.h
index 20e245ece8..953b43c038 100644
--- a/arm_compute/core/CL/CLKernelLibrary.h
+++ b/arm_compute/core/CL/CLKernelLibrary.h
@@ -261,6 +261,12 @@ public:
{
_device = std::move(device);
}
+
+ /** Return the device version
+ *
+ * @return The content of CL_DEVICE_VERSION
+ */
+ std::string get_device_version();
/** Creates a kernel from the kernel library.
*
* @param[in] kernel_name Kernel name.
diff --git a/src/core/CL/CLKernelLibrary.cpp b/src/core/CL/CLKernelLibrary.cpp
index c7c08d4b49..caf017d984 100644
--- a/src/core/CL/CLKernelLibrary.cpp
+++ b/src/core/CL/CLKernelLibrary.cpp
@@ -840,3 +840,8 @@ cl::NDRange CLKernelLibrary::default_ndrange() const
{
return cl::NDRange(128u, 1);
}
+
+std::string CLKernelLibrary::get_device_version()
+{
+ return _device.getInfo<CL_DEVICE_VERSION>();
+}
diff --git a/tests/benchmark_examples/RunExample.cpp b/tests/benchmark_examples/RunExample.cpp
index 722a60e1f2..f1dca819ab 100644
--- a/tests/benchmark_examples/RunExample.cpp
+++ b/tests/benchmark_examples/RunExample.cpp
@@ -130,6 +130,16 @@ int run_example(int argc, char **argv, Example &example)
{
for(auto &p : printers)
{
+#ifdef ARM_COMPUTE_CL
+ if(opencl_is_available())
+ {
+ p->print_entry("CL_DEVICE_VERSION", CLKernelLibrary::get().get_device_version());
+ }
+ else
+ {
+ p->print_entry("CL_DEVICE_VERSION", "Unavailable");
+ }
+#endif /* ARM_COMPUTE_CL */
p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value()));
p->print_entry("Threads", support::cpp11::to_string(options.threads->value()));
}
diff --git a/tests/main.cpp b/tests/main.cpp
index 1f3c365c03..4a8a82d490 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -130,6 +130,16 @@ int main(int argc, char **argv)
{
p->print_entry("Version", build_information());
p->print_entry("Seed", support::cpp11::to_string(seed->value()));
+#ifdef ARM_COMPUTE_CL
+ if(opencl_is_available())
+ {
+ p->print_entry("CL_DEVICE_VERSION", CLKernelLibrary::get().get_device_version());
+ }
+ else
+ {
+ p->print_entry("CL_DEVICE_VERSION", "Unavailable");
+ }
+#endif /* ARM_COMPUTE_CL */
p->print_entry("Iterations", support::cpp11::to_string(options.iterations->value()));
p->print_entry("Threads", support::cpp11::to_string(options.threads->value()));
{