aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-03-07 11:35:53 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:48:33 +0000
commit847864df46cea578bb0766c17c95ad5e804c49c3 (patch)
tree553f4c383b6a81b43b8634ea9856cd8dbeae0a27
parent4a65b9855f71fff11a4c18d2fa4bccc74303e5c6 (diff)
downloadComputeLibrary-847864df46cea578bb0766c17c95ad5e804c49c3.tar.gz
COMPMID-995 Add CL_DEVICE_VERSION to the test framework output
Change-Id: Ic32742388fbd45c8acc395977586204980eff591 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/123541 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Kevin Petit <kevin.petit@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
-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()));
{