aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm_compute/core/CL/OpenCL.h2
-rw-r--r--src/core/CL/OpenCL.cpp15
2 files changed, 17 insertions, 0 deletions
diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h
index 644608ff3d..bea9743f48 100644
--- a/arm_compute/core/CL/OpenCL.h
+++ b/arm_compute/core/CL/OpenCL.h
@@ -72,6 +72,7 @@ public:
using clRetainContext_func = cl_int (*)(cl_context context);
using clReleaseProgram_func = cl_int (*)(cl_program program);
using clFlush_func = cl_int (*)(cl_command_queue command_queue);
+ using clFinish_func = cl_int (*)(cl_command_queue command_queue);
using clGetProgramInfo_func = cl_int (*)(cl_program, cl_program_info, size_t, void *, size_t *);
using clCreateKernel_func = cl_kernel (*)(cl_program, const char *, cl_int *);
using clRetainKernel_func = cl_int (*)(cl_kernel kernel);
@@ -91,6 +92,7 @@ public:
clCreateKernel_func clCreateKernel = nullptr;
clGetProgramInfo_func clGetProgramInfo = nullptr;
clFlush_func clFlush = nullptr;
+ clFinish_func clFinish = nullptr;
clReleaseProgram_func clReleaseProgram = nullptr;
clRetainContext_func clRetainContext = nullptr;
clCreateProgramWithBinary_func clCreateProgramWithBinary = nullptr;
diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp
index 4eba709b52..085e186543 100644
--- a/src/core/CL/OpenCL.cpp
+++ b/src/core/CL/OpenCL.cpp
@@ -81,6 +81,7 @@ bool CLSymbols::load(const std::string &library)
clCreateKernel = reinterpret_cast<clCreateKernel_func>(dlsym(handle, "clCreateKernel"));
clGetProgramInfo = reinterpret_cast<clGetProgramInfo_func>(dlsym(handle, "clGetProgramInfo"));
clFlush = reinterpret_cast<clFlush_func>(dlsym(handle, "clFlush"));
+ clFinish = reinterpret_cast<clFinish_func>(dlsym(handle, "clFinish"));
clReleaseProgram = reinterpret_cast<clReleaseProgram_func>(dlsym(handle, "clReleaseProgram"));
clRetainContext = reinterpret_cast<clRetainContext_func>(dlsym(handle, "clRetainContext"));
clCreateProgramWithBinary = reinterpret_cast<clCreateProgramWithBinary_func>(dlsym(handle, "clCreateProgramWithBinary"));
@@ -438,6 +439,20 @@ cl_int clFlush(cl_command_queue command_queue)
}
}
+cl_int clFinish(cl_command_queue command_queue)
+{
+ arm_compute::CLSymbols::get().load_default();
+ auto func = arm_compute::CLSymbols::get().clFinish;
+ if(func != nullptr)
+ {
+ return func(command_queue);
+ }
+ else
+ {
+ return CL_OUT_OF_RESOURCES;
+ }
+}
+
cl_int clGetProgramInfo(
cl_program program,
cl_program_info param_name,