aboutsummaryrefslogtreecommitdiff
path: root/tests/validate_examples/RunExample.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validate_examples/RunExample.cpp')
-rw-r--r--tests/validate_examples/RunExample.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/validate_examples/RunExample.cpp b/tests/validate_examples/RunExample.cpp
index 8ba3c2b295..36bf587551 100644
--- a/tests/validate_examples/RunExample.cpp
+++ b/tests/validate_examples/RunExample.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2021 Arm Limited.
+ * Copyright (c) 2018-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,6 +29,7 @@
#include "ValidateExample.h"
#include "arm_compute/runtime/CL/CLHelpers.h"
#include "arm_compute/runtime/Scheduler.h"
+#include "arm_compute/core/Version.h"
#include "tests/AssetsLibrary.h"
#include "tests/Globals.h"
#include "tests/framework/Framework.h"
@@ -150,7 +151,16 @@ int run_example(int argc, char **argv, std::unique_ptr<ValidateExample> example)
#ifdef ARM_COMPUTE_CL
if(opencl_is_available())
{
- auto ctx_dev_err = create_opencl_context_and_device();
+ CLBackendType backend_type = CLBackendType::Native;
+ for(auto &arg : example_args->value())
+ {
+ if(arg.find("--target=clvk") != std::string::npos)
+ {
+ backend_type = CLBackendType::Clvk;
+ break;
+ }
+ }
+ auto ctx_dev_err = create_opencl_context_and_device(backend_type);
ARM_COMPUTE_ERROR_ON_MSG(std::get<2>(ctx_dev_err) != CL_SUCCESS, "Failed to create OpenCL context");
CLScheduler::get().default_init_with_context(std::get<1>(ctx_dev_err), std::get<0>(ctx_dev_err), nullptr);
}