From b015e5db20e29825caefa05d828fbeed73119b19 Mon Sep 17 00:00:00 2001 From: David Monahan Date: Wed, 26 Feb 2020 10:24:03 +0000 Subject: Modifying the IBackendProfilingContext interface to return a bool on EnableProfiling and adding error checking to the Runtime Invocation Signed-off-by: David Monahan Change-Id: I65b8bb16c6f1c7d668de31238ce0408a48974997 --- src/armnn/Runtime.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/armnn') diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp index c1416f94d7..b1017c58ed 100644 --- a/src/armnn/Runtime.cpp +++ b/src/armnn/Runtime.cpp @@ -192,8 +192,16 @@ Runtime::Runtime(const CreationOptions& options) // Backends that don't support profiling will return a null profiling context. if (profilingContext) { - // Pass the context onto the profiling service. - armnn::profiling::ProfilingService::Instance().AddBackendProfilingContext(id, profilingContext); + // Enable profiling on the backend and assert that it returns true + if(profilingContext->EnableProfiling(true)) + { + // Pass the context onto the profiling service. + armnn::profiling::ProfilingService::Instance().AddBackendProfilingContext(id, profilingContext); + } + else + { + throw BackendProfilingException("Unable to enable profiling on Backend Id: " + id.Get()); + } } } catch (const BackendUnavailableException&) -- cgit v1.2.1