From ca65af3542134841b79b94060195fd9a65224d6a Mon Sep 17 00:00:00 2001 From: Vidhya Sudhan Loganathan Date: Thu, 7 Feb 2019 11:14:42 +0000 Subject: COMPMID-1919: Opencl - Tuning with Instrumentation does not work Change-Id: Iee6a07d5bf6a35af04071865682bcc4a615c14f9 Signed-off-by: Vidhya Sudhan Loganathan Reviewed-on: https://review.mlplatform.org/638 Reviewed-by: Giuseppe Rossini Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez --- tests/framework/instruments/OpenCLTimer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/framework') diff --git a/tests/framework/instruments/OpenCLTimer.cpp b/tests/framework/instruments/OpenCLTimer.cpp index 2fd5714f65..ca859b6fd9 100644 --- a/tests/framework/instruments/OpenCLTimer.cpp +++ b/tests/framework/instruments/OpenCLTimer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -107,9 +107,6 @@ void OpenCLClock::test_start() { if(this->_timer_enabled) { - ARM_COMPUTE_ERROR_ON_MSG(event != nullptr, "Not supported"); - ARM_COMPUTE_UNUSED(event); - kernel_info info; cl::Kernel cpp_kernel(kernel, true); std::stringstream ss; @@ -127,6 +124,13 @@ void OpenCLClock::test_start() cl_int retval = this->_real_function(command_queue, kernel, work_dim, gwo, gws, lws, num_events_in_wait_list, event_wait_list, &tmp); info.event = tmp; this->_kernels.push_back(std::move(info)); + + if(event != nullptr) + { + //return cl_event from the intercepted call + clRetainEvent(tmp); + *event = tmp; + } return retval; } else -- cgit v1.2.1