diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2015-07-16 12:47:47 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-07-17 15:27:12 +0800 |
commit | 10e301e1d1a0622864fb02729eaa9f4f2b29f6ad (patch) | |
tree | fce42a8de4451082d76e4f831c02532c7dde738d /src/cl_context.c | |
parent | 804d54d1eb21927a111d033718a1e3516808b3b5 (diff) |
Remove deprecated function cl_context_get_static_kernel().
Also fix a spelling bug - s/internel/internal.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_context.c')
-rw-r--r-- | src/cl_context.c | 73 |
1 files changed, 11 insertions, 62 deletions
diff --git a/src/cl_context.c b/src/cl_context.c index 5b9da231..c45e0aa7 100644 --- a/src/cl_context.c +++ b/src/cl_context.c @@ -199,16 +199,16 @@ cl_context_delete(cl_context ctx) /* delete the internal programs. */ for (i = CL_INTERNAL_KERNEL_MIN; i < CL_INTERNAL_KERNEL_MAX; i++) { - if (ctx->internel_kernels[i]) { - cl_kernel_delete(ctx->internel_kernels[i]); - ctx->internel_kernels[i] = NULL; + if (ctx->internal_kernels[i]) { + cl_kernel_delete(ctx->internal_kernels[i]); + ctx->internal_kernels[i] = NULL; assert(ctx->internal_prgs[i]); cl_program_delete(ctx->internal_prgs[i]); ctx->internal_prgs[i] = NULL; } - if (ctx->internel_kernels[i]) { + if (ctx->internal_kernels[i]) { cl_kernel_delete(ctx->built_in_kernels[i]); ctx->built_in_kernels[i] = NULL; } @@ -269,57 +269,6 @@ cl_context_get_bufmgr(cl_context ctx) } cl_kernel -cl_context_get_static_kernel(cl_context ctx, cl_int index, const char * str_kernel, const char * str_option) -{ - cl_int ret; - if (!ctx->internal_prgs[index]) { - size_t length = strlen(str_kernel) + 1; - ctx->internal_prgs[index] = cl_program_create_from_source(ctx, 1, &str_kernel, &length, NULL); - - if (!ctx->internal_prgs[index]) - return NULL; - - ret = cl_program_build(ctx->internal_prgs[index], str_option); - if (ret != CL_SUCCESS) - return NULL; - - ctx->internal_prgs[index]->is_built = 1; - - /* All CL_ENQUEUE_FILL_BUFFER_ALIGN16_xxx use the same program, different kernel. */ - if (index >= CL_ENQUEUE_FILL_BUFFER_ALIGN8_8 && index <= CL_ENQUEUE_FILL_BUFFER_ALIGN8_64) { - int i = CL_ENQUEUE_FILL_BUFFER_ALIGN8_8; - for (; i <= CL_ENQUEUE_FILL_BUFFER_ALIGN8_64; i++) { - if (index != i) { - assert(ctx->internal_prgs[i] == NULL); - assert(ctx->internel_kernels[i] == NULL); - cl_program_add_ref(ctx->internal_prgs[index]); - ctx->internal_prgs[i] = ctx->internal_prgs[index]; - } - - if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_8) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], - "__cl_fill_region_align8_2", NULL); - } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_16) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], - "__cl_fill_region_align8_4", NULL); - } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_32) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], - "__cl_fill_region_align8_8", NULL); - } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_64) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], - "__cl_fill_region_align8_16", NULL); - } else - assert(0); - } - } else { - ctx->internel_kernels[index] = cl_kernel_dup(ctx->internal_prgs[index]->ker[0]); - } - } - - return ctx->internel_kernels[index]; -} - -cl_kernel cl_context_get_static_kernel_from_bin(cl_context ctx, cl_int index, const char * str_kernel, size_t size, const char * str_option) { @@ -349,31 +298,31 @@ cl_context_get_static_kernel_from_bin(cl_context ctx, cl_int index, for (; i <= CL_ENQUEUE_FILL_BUFFER_ALIGN8_64; i++) { if (index != i) { assert(ctx->internal_prgs[i] == NULL); - assert(ctx->internel_kernels[i] == NULL); + assert(ctx->internal_kernels[i] == NULL); cl_program_add_ref(ctx->internal_prgs[index]); ctx->internal_prgs[i] = ctx->internal_prgs[index]; } if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_8) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], + ctx->internal_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], "__cl_fill_region_align8_2", NULL); } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_16) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], + ctx->internal_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], "__cl_fill_region_align8_4", NULL); } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_32) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], + ctx->internal_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], "__cl_fill_region_align8_8", NULL); } else if (i == CL_ENQUEUE_FILL_BUFFER_ALIGN8_64) { - ctx->internel_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], + ctx->internal_kernels[i] = cl_program_create_kernel(ctx->internal_prgs[index], "__cl_fill_region_align8_16", NULL); } else assert(0); } } else { - ctx->internel_kernels[index] = cl_kernel_dup(ctx->internal_prgs[index]->ker[0]); + ctx->internal_kernels[index] = cl_kernel_dup(ctx->internal_prgs[index]->ker[0]); } } - ker = ctx->internel_kernels[index]; + ker = ctx->internal_kernels[index]; unlock: pthread_mutex_unlock(&ctx->program_lock); |