aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2019-04-03 15:11:16 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2019-04-09 16:51:03 +0000
commit4d0351cf322df51baa5a445f637008992aa37809 (patch)
tree411e748a6bb5b64920780382e0613596dcd55ccf /src/core
parenta4bba9c594c4022c9f85192bb8fd3593ad1a8d3c (diff)
downloadComputeLibrary-4d0351cf322df51baa5a445f637008992aa37809.tar.gz
COMPMID-2057: Implement and test import memory interfaces.
Change-Id: I1559bea47ae6403177d248e2f7be47d5f1a6513f Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Reviewed-on: https://review.mlplatform.org/c/956 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CL/OpenCL.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/core/CL/OpenCL.cpp b/src/core/CL/OpenCL.cpp
index 6725f36a5d..ef03a5a302 100644
--- a/src/core/CL/OpenCL.cpp
+++ b/src/core/CL/OpenCL.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018 ARM Limited.
+ * Copyright (c) 2017-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -120,6 +120,9 @@ bool CLSymbols::load(const std::string &library)
LOAD_FUNCTION_PTR(clEnqueueMarker, handle);
LOAD_FUNCTION_PTR(clWaitForEvents, handle);
+ // Third-party extensions
+ LOAD_FUNCTION_PTR(clImportMemoryARM, handle);
+
#undef LOAD_FUNCTION_PTR
//Don't call dlclose(handle) or all the symbols will be unloaded !
@@ -919,3 +922,27 @@ clGetEventProfilingInfo(cl_event event,
return CL_OUT_OF_RESOURCES;
}
}
+
+cl_mem
+clImportMemoryARM(cl_context context,
+ cl_mem_flags flags,
+ const cl_import_properties_arm *properties,
+ void *memory,
+ size_t size,
+ cl_int *errcode_ret)
+{
+ arm_compute::CLSymbols::get().load_default();
+ auto func = arm_compute::CLSymbols::get().clImportMemoryARM_ptr;
+ if(func != nullptr)
+ {
+ return func(context, flags, properties, memory, size, errcode_ret);
+ }
+ else
+ {
+ if(errcode_ret != nullptr)
+ {
+ *errcode_ret = CL_OUT_OF_RESOURCES;
+ }
+ return nullptr;
+ }
+} \ No newline at end of file