summaryrefslogtreecommitdiff
path: root/src/cl_context.c
diff options
context:
space:
mode:
authorYang, Rong R <rong.r.yang@intel.com>2016-11-28 19:32:31 +0800
committerYang Rong <rong.r.yang@intel.com>2016-12-28 17:37:07 +0800
commit9e0477db325e033d3e926680b58c5b7c36392528 (patch)
treed816f93b177dae7c8d2efbf3654ef7f5eac287f7 /src/cl_context.c
parent7af85ed6ad84f8eda3950bb0b64cc2360278e299 (diff)
Runtime: fix fill image event assert and some SVM rebase error.
Also remove the useless function cl_context_add_svm. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
Diffstat (limited to 'src/cl_context.c')
-rw-r--r--src/cl_context.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/cl_context.c b/src/cl_context.c
index 6b6cd624..de5c2899 100644
--- a/src/cl_context.c
+++ b/src/cl_context.c
@@ -81,19 +81,6 @@ cl_context_add_mem(cl_context ctx, cl_mem mem) {
}
LOCAL void
-cl_context_add_svm(cl_context ctx, cl_mem mem) {
- assert(mem->ctx == NULL);
- cl_context_add_ref(ctx);
-
- CL_OBJECT_LOCK(ctx);
- list_add_tail(&ctx->svm_objects, &mem->base.node);
- ctx->svm_object_num++;
- CL_OBJECT_UNLOCK(ctx);
-
- mem->ctx = ctx;
-}
-
-LOCAL void
cl_context_remove_mem(cl_context ctx, cl_mem mem) {
assert(mem->ctx == ctx);
CL_OBJECT_LOCK(ctx);
@@ -481,6 +468,7 @@ cl_context_get_svm_from_ptr(cl_context ctx, const void * p)
buf = (cl_mem)list_entry(pos, _cl_base_object, node);
if(buf->host_ptr == NULL) continue;
if(buf->is_svm == 0) continue;
+ if(buf->type != CL_MEM_SVM_TYPE) continue;
if((size_t)buf->host_ptr <= (size_t)p &&
(size_t)p < ((size_t)buf->host_ptr + buf->size))
return buf;