summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorJunyan He <junyan.he@intel.com>2016-09-02 14:38:05 +0800
committerYang Rong <rong.r.yang@intel.com>2016-09-02 17:34:01 +0800
commitd743c188e3a0d9827a1de88bb03fd6d8a4fafef4 (patch)
tree4c361b5c2c90d669734013a31dde553627dfd902 /src/CMakeLists.txt
parenteff426bbd846d96cf78e288bf37b5a42ce294c50 (diff)
downloadbeignet-d743c188e3a0d9827a1de88bb03fd6d8a4fafef4.tar.gz
Runtime: Add CL base object for all cl objects.
The runtime code is a little verbose in CL object handle. Every CL objects should have a reference, a lock to protect itself and an ICD dispatcher. We can organize them to a struct and place it at the beginning of each CL object. This base object is also used to protect the CL objects MT safe. CL_OBJECT_LOCK/CL_OBJECT_UNLOCK macro will lock/unlock objects, but we should use them within one function call, and the critical region should be short. We add CL_OBJECT_TAKE_OWNERSHIP/CL_OBJECT_RELEASE_OWNERSHIP macro to own the object for a long time. CL_OBJECT_TAKE_OWNERSHIP will not hold the lock and so will not cause deadlock problems. For example, when we call NDRange on some memobj, we should take the ownship of the memobj. If another thread call NDRange on the same memobj, we should return some error like CL_OUT_OF_RESOURCE to users and protect the memobj from accessing simultaneously. V2: Add atomic_read to avoid atomic_add misuse. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a0028651..cec7cfcd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -65,6 +65,7 @@ MakeKernelBinStr ("${CMAKE_CURRENT_SOURCE_DIR}/kernels/" "${BUILT_IN_NAME}")
set(OPENCL_SRC
${KERNEL_STR_FILES}
+ cl_base_object.c
cl_api.c
cl_alloc.c
cl_kernel.c