aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLHelpers.h
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2021-04-20 11:26:21 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-21 20:48:28 +0000
commit402740da11c4fd2a9dc7aee5dadf3b1fdda0afde (patch)
tree61501d2f0af7115b87d26907d6ca9a3d00f4ef5e /arm_compute/runtime/CL/CLHelpers.h
parentbff2f9f2f92bf7a8d2f7532df0329dedfbe84693 (diff)
downloadComputeLibrary-402740da11c4fd2a9dc7aee5dadf3b1fdda0afde.tar.gz
Add support for CLVK
This patch enables CLVK through the graph API and inside the CLScheduler. By default the Native platform is selected. Selecting CLVK can be done via --target=clvk. Resolves COMPMID-4205 and COMPMID-4206 Change-Id: Ic60744980c6b8a60e776627ea677ed46be88f656 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5475 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL/CLHelpers.h')
-rw-r--r--arm_compute/runtime/CL/CLHelpers.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/arm_compute/runtime/CL/CLHelpers.h b/arm_compute/runtime/CL/CLHelpers.h
index 9b71561c39..fef2619071 100644
--- a/arm_compute/runtime/CL/CLHelpers.h
+++ b/arm_compute/runtime/CL/CLHelpers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 Arm Limited.
+ * Copyright (c) 2019-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -25,6 +25,7 @@
#define ARM_COMPUTE_CL_HELPERS_H
#include "arm_compute/core/CL/OpenCL.h"
+#include "arm_compute/runtime/CL/CLTypes.h"
#include "arm_compute/runtime/IScheduler.h"
namespace arm_compute
@@ -37,11 +38,13 @@ class ICLKernel;
*
* @note In debug builds, the function will automatically enable cl_arm_printf if the driver/device supports it.
*
+ * @param[in] cl_backend_type The OpenCL backend type to use.
+ *
* @return A std::tuple where the first element is the opencl context, the second element is the opencl device
* and the third one an error code. The error code will be CL_SUCCESS upon successful creation, otherwise
* a value telling why the function failed.
*/
-std::tuple<cl::Context, cl::Device, cl_int> create_opencl_context_and_device();
+std::tuple<cl::Context, cl::Device, cl_int> create_opencl_context_and_device(CLBackendType cl_backend_type);
/** Schedules a kernel using the context if not nullptr else uses the legacy scheduling flow.
*
* @param[in] ctx Context to use.
@@ -49,5 +52,13 @@ std::tuple<cl::Context, cl::Device, cl_int> create_opencl_context_and_device();
* @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel.
*/
void schedule_kernel_on_ctx(CLRuntimeContext *ctx, ICLKernel *kernel, bool flush = true);
+
+/** This function selects the OpenCL platform based on the backend type.
+ *
+ * @param[in] cl_backend_type The OpenCL backend type to use.
+ *
+ * @return A cl::Platform object.
+ */
+cl::Platform select_preferable_platform(CLBackendType cl_backend_type);
} // namespace arm_compute
#endif /* ARM_COMPUTE_CL_HELPERS_H */