From 34702479adcf3559e8ebe27915179af509b070d2 Mon Sep 17 00:00:00 2001 From: steniu01 Date: Tue, 11 Jul 2017 09:22:58 +0100 Subject: COMPMID-417 Checking CL non uniform support at runtime. What have been done in the ticket are: 1. Add support to check whether cl-non-unform-workgroup is supported at runtime 2. Add helper function to check the CL version at runtime 3. Add boolen to check whether CLSecheduler's init has been called. Change-Id: I6e6df8eb5cebfac7229aa406242bb183477fd191 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80265 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/runtime/CL/CLScheduler.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'arm_compute/runtime/CL/CLScheduler.h') diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index 8e80259b59..3f3a8de753 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -72,9 +72,10 @@ public: void init(cl::Context context = cl::Context::getDefault(), cl::CommandQueue queue = cl::CommandQueue::getDefault(), cl::Device device = cl::Device::getDefault()) { - _context = std::move(context); - _queue = std::move(queue); - _target = get_target_from_device(device); + _context = std::move(context); + _queue = std::move(queue); + _target = get_target_from_device(device); + _is_initialised = true; } /** Accessor for the associated CL context. @@ -83,6 +84,7 @@ public: */ cl::Context &context() { + ARM_COMPUTE_ERROR_ON(!_is_initialised); return _context; } @@ -101,6 +103,7 @@ public: */ cl::CommandQueue &queue() { + ARM_COMPUTE_ERROR_ON(!_is_initialised); return _queue; } @@ -153,6 +156,7 @@ private: cl::Context _context; cl::CommandQueue _queue; GPUTarget _target; + bool _is_initialised; }; } #endif /* __ARM_COMPUTE_CLSCHEDULER_H__ */ -- cgit v1.2.1