diff options
author | Junyan He <junyan.he@linux.intel.com> | 2014-05-30 14:28:30 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-05-30 14:55:22 +0800 |
commit | 1af480108c48e58f04126d195b413ab4c6552594 (patch) | |
tree | 82c88a876c882573b88b4331e400a03c41f1122f /src/cl_context.c | |
parent | 0db692659e4bc6ce25c19cb56ae07f2c46425d6e (diff) | |
download | beignet-1af480108c48e58f04126d195b413ab4c6552594.tar.gz |
Refine the cl thread implement for queue.
Because the cl_command_queue can be used in several threads simultaneously but
without add ref to it, we now handle it like this:
Keep one threads_slot_array, every time the thread get gpgpu or batch buffer, if it
does not have a slot, assign it.
The resources are keeped in queue private, and resize it if needed.
When the thread exit, the slot will be set invalid.
When queue released, all the resources will be released. If user still enqueue, flush
or finish the queue after it has been released, the behavior is undefined.
TODO: Need to shrink the slot map.
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src/cl_context.c')
-rw-r--r-- | src/cl_context.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/cl_context.c b/src/cl_context.c index 8190e6a8..1911bf21 100644 --- a/src/cl_context.c +++ b/src/cl_context.c @@ -203,7 +203,6 @@ cl_context_delete(cl_context ctx) assert(ctx->buffers == NULL); assert(ctx->drv); cl_free(ctx->prop_user); - cl_set_thread_batch_buf(NULL); cl_driver_delete(ctx->drv); ctx->magic = CL_MAGIC_DEAD_HEADER; /* For safety */ cl_free(ctx); |