[Beignet] [PATCH] remove RTLD_DEEPBIND to avoid stdc++ issues
Junyan He
junyan.he at aim.com
Wed Jun 11 22:20:32 PDT 2014
OK, after apply it
I can not duplicate the error found before now.
On Thu, 2014-06-12 at 02:38 +0800, Guo Yejun wrote:
> there are weired issues about stdc++ when dlopen .so file with flag
> RTLD_DEEPBIND, remove the flag by renaming the function pointer names.
> The new names in runtime begin with interp_*, meaning that they finally
> go into libgbeinterp.so to interpret the meta data of binary kernel.
>
> Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> ---
> src/cl_command_queue.c | 16 ++--
> src/cl_command_queue_gen7.c | 60 ++++++-------
> src/cl_device_id.c | 2 +-
> src/cl_gbe_loader.cpp | 206 ++++++++++++++++++++++----------------------
> src/cl_gbe_loader.h | 37 +++++++-
> src/cl_kernel.c | 36 ++++----
> src/cl_program.c | 18 ++--
> src/intel/intel_driver.c | 2 +-
> 8 files changed, 206 insertions(+), 171 deletions(-)
>
> diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c
> index 618be65..15b0ead 100644
> --- a/src/cl_command_queue.c
> +++ b/src/cl_command_queue.c
> @@ -130,7 +130,7 @@ cl_command_queue_bind_image(cl_command_queue queue, cl_kernel k)
> for (i = 0; i < k->image_sz; i++) {
> int id = k->images[i].arg_idx;
> struct _cl_mem_image *image;
> - assert(gbe_kernel_get_arg_type(k->opaque, id) == GBE_ARG_IMAGE);
> + assert(interp_kernel_get_arg_type(k->opaque, id) == GBE_ARG_IMAGE);
> image = cl_mem_image(k->args[id].mem);
> set_image_info(k->curbe, &k->images[i], image);
> cl_gpgpu_bind_image(gpgpu, k->images[i].idx, image->base.bo, image->offset,
> @@ -151,10 +151,10 @@ cl_command_queue_bind_surface(cl_command_queue queue, cl_kernel k)
> enum gbe_arg_type arg_type; /* kind of argument */
> for (i = 0; i < k->arg_n; ++i) {
> uint32_t offset; // location of the address in the curbe
> - arg_type = gbe_kernel_get_arg_type(k->opaque, i);
> + arg_type = interp_kernel_get_arg_type(k->opaque, i);
> if (arg_type != GBE_ARG_GLOBAL_PTR || !k->args[i].mem)
> continue;
> - offset = gbe_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, i);
> + offset = interp_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, i);
> if (k->args[i].mem->type == CL_MEM_SUBBUFFER_TYPE) {
> struct _cl_mem_buffer* buffer = (struct _cl_mem_buffer*)k->args[i].mem;
> cl_gpgpu_bind_buf(gpgpu, k->args[i].mem->bo, offset, buffer->sub_offset, cl_gpgpu_get_cache_ctrl());
> @@ -208,7 +208,7 @@ cl_fulsim_dump_all_surfaces(cl_command_queue queue, cl_kernel k)
> /* Bind user defined surface */
> for (i = 0; i < k->arg_n; ++i) {
> size_t chunk_n, chunk_remainder;
> - if (gbe_kernel_get_arg_type(k->opaque, i) != GBE_ARG_GLOBAL_PTR)
> + if (interp_kernel_get_arg_type(k->opaque, i) != GBE_ARG_GLOBAL_PTR)
> continue;
> mem = (cl_mem) k->args[i].mem;
> CHECK_MEM(mem);
> @@ -316,7 +316,7 @@ cl_fulsim_read_all_surfaces(cl_command_queue queue, cl_kernel k)
> int i, curr = 0;
> /* Bind user defined surface */
> for (i = 0; i < k->arg_n; ++i) {
> - if (gbe_kernel_get_arg_type(k->opaque, i) != GBE_ARG_GLOBAL_PTR)
> + if (interp_kernel_get_arg_type(k->opaque, i) != GBE_ARG_GLOBAL_PTR)
> continue;
> mem = (cl_mem) k->args[i].mem;
> CHECK_MEM(mem);
> @@ -425,14 +425,14 @@ cl_command_queue_flush(cl_command_queue queue)
>
> cl_gpgpu_flush(gpgpu);
>
> - if (printf_info && gbe_get_printf_num(printf_info)) {
> + if (printf_info && interp_get_printf_num(printf_info)) {
> void *index_addr = cl_gpgpu_map_printf_buffer(gpgpu, 0);
> void *buf_addr = cl_gpgpu_map_printf_buffer(gpgpu, 1);
> - gbe_output_printf(printf_info, index_addr, buf_addr, global_wk_sz[0],
> + interp_output_printf(printf_info, index_addr, buf_addr, global_wk_sz[0],
> global_wk_sz[1], global_wk_sz[2]);
> cl_gpgpu_unmap_printf_buffer(gpgpu, 0);
> cl_gpgpu_unmap_printf_buffer(gpgpu, 1);
> - gbe_release_printf_info(printf_info);
> + interp_release_printf_info(printf_info);
> global_wk_sz[0] = global_wk_sz[1] = global_wk_sz[2] = 0;
> cl_gpgpu_set_printf_info(gpgpu, NULL, global_wk_sz);
> }
> diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
> index 9680535..2223f4f 100644
> --- a/src/cl_command_queue_gen7.c
> +++ b/src/cl_command_queue_gen7.c
> @@ -50,10 +50,10 @@ cl_set_varying_payload(const cl_kernel ker,
> int32_t id_offset[3], ip_offset;
> cl_int err = CL_SUCCESS;
>
> - id_offset[0] = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_X, 0);
> - id_offset[1] = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_Y, 0);
> - id_offset[2] = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_Z, 0);
> - ip_offset = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_BLOCK_IP, 0);
> + id_offset[0] = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_X, 0);
> + id_offset[1] = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_Y, 0);
> + id_offset[2] = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_LOCAL_ID_Z, 0);
> + ip_offset = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_BLOCK_IP, 0);
> assert(id_offset[0] >= 0 &&
> id_offset[1] >= 0 &&
> id_offset[2] >= 0 &&
> @@ -107,16 +107,16 @@ cl_upload_constant_buffer(cl_command_queue queue, cl_kernel ker)
> size_t offset = 0;
> uint32_t raw_size = 0, aligned_size =0;
> gbe_program prog = ker->program->opaque;
> - const int32_t arg_n = gbe_kernel_get_arg_num(ker->opaque);
> - size_t global_const_size = gbe_program_get_global_constant_size(prog);
> + const int32_t arg_n = interp_kernel_get_arg_num(ker->opaque);
> + size_t global_const_size = interp_program_get_global_constant_size(prog);
> aligned_size = raw_size = global_const_size;
> /* Reserve 8 bytes to get rid of 0 address */
> if(global_const_size == 0) aligned_size = 8;
>
> for (arg = 0; arg < arg_n; ++arg) {
> - const enum gbe_arg_type type = gbe_kernel_get_arg_type(ker->opaque, arg);
> + const enum gbe_arg_type type = interp_kernel_get_arg_type(ker->opaque, arg);
> if (type == GBE_ARG_CONSTANT_PTR && ker->args[arg].mem) {
> - uint32_t alignment = gbe_kernel_get_arg_align(ker->opaque, arg);
> + uint32_t alignment = interp_kernel_get_arg_align(ker->opaque, arg);
> assert(alignment != 0);
> cl_mem mem = ker->args[arg].mem;
> raw_size += mem->size;
> @@ -133,7 +133,7 @@ cl_upload_constant_buffer(cl_command_queue queue, cl_kernel ker)
>
> /* upload the global constant data */
> if (global_const_size > 0) {
> - gbe_program_get_global_constant_data(prog, (char*)(cst_addr+offset));
> + interp_program_get_global_constant_data(prog, (char*)(cst_addr+offset));
> offset += global_const_size;
> }
>
> @@ -145,12 +145,12 @@ cl_upload_constant_buffer(cl_command_queue queue, cl_kernel ker)
> /* upload constant buffer argument */
> int32_t curbe_offset = 0;
> for (arg = 0; arg < arg_n; ++arg) {
> - const enum gbe_arg_type type = gbe_kernel_get_arg_type(ker->opaque, arg);
> + const enum gbe_arg_type type = interp_kernel_get_arg_type(ker->opaque, arg);
> if (type == GBE_ARG_CONSTANT_PTR && ker->args[arg].mem) {
> cl_mem mem = ker->args[arg].mem;
> - uint32_t alignment = gbe_kernel_get_arg_align(ker->opaque, arg);
> + uint32_t alignment = interp_kernel_get_arg_align(ker->opaque, arg);
> offset = ALIGN(offset, alignment);
> - curbe_offset = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_KERNEL_ARGUMENT, arg);
> + curbe_offset = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_KERNEL_ARGUMENT, arg);
> assert(curbe_offset >= 0);
> *(uint32_t *) (ker->curbe + curbe_offset) = offset;
>
> @@ -175,7 +175,7 @@ cl_curbe_fill(cl_kernel ker,
> {
> int32_t offset;
> #define UPLOAD(ENUM, VALUE) \
> - if ((offset = gbe_kernel_get_curbe_offset(ker->opaque, ENUM, 0)) >= 0) \
> + if ((offset = interp_kernel_get_curbe_offset(ker->opaque, ENUM, 0)) >= 0) \
> *((uint32_t *) (ker->curbe + offset)) = VALUE;
> UPLOAD(GBE_CURBE_LOCAL_SIZE_X, local_wk_sz[0]);
> UPLOAD(GBE_CURBE_LOCAL_SIZE_Y, local_wk_sz[1]);
> @@ -196,24 +196,24 @@ cl_curbe_fill(cl_kernel ker,
> /* Write identity for the stack pointer. This is required by the stack pointer
> * computation in the kernel
> */
> - if ((offset = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_STACK_POINTER, 0)) >= 0) {
> - const uint32_t simd_sz = gbe_kernel_get_simd_width(ker->opaque);
> + if ((offset = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_STACK_POINTER, 0)) >= 0) {
> + const uint32_t simd_sz = interp_kernel_get_simd_width(ker->opaque);
> uint32_t *stackptr = (uint32_t *) (ker->curbe + offset);
> int32_t i;
> for (i = 0; i < (int32_t) simd_sz; ++i) stackptr[i] = i;
> }
> /* Handle the various offsets to SLM */
> - const int32_t arg_n = gbe_kernel_get_arg_num(ker->opaque);
> - int32_t arg, slm_offset = gbe_kernel_get_slm_size(ker->opaque);
> + const int32_t arg_n = interp_kernel_get_arg_num(ker->opaque);
> + int32_t arg, slm_offset = interp_kernel_get_slm_size(ker->opaque);
> ker->local_mem_sz = 0;
> for (arg = 0; arg < arg_n; ++arg) {
> - const enum gbe_arg_type type = gbe_kernel_get_arg_type(ker->opaque, arg);
> + const enum gbe_arg_type type = interp_kernel_get_arg_type(ker->opaque, arg);
> if (type != GBE_ARG_LOCAL_PTR)
> continue;
> - uint32_t align = gbe_kernel_get_arg_align(ker->opaque, arg);
> + uint32_t align = interp_kernel_get_arg_align(ker->opaque, arg);
> assert(align != 0);
> slm_offset = ALIGN(slm_offset, align);
> - offset = gbe_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_KERNEL_ARGUMENT, arg);
> + offset = interp_kernel_get_curbe_offset(ker->opaque, GBE_CURBE_KERNEL_ARGUMENT, arg);
> assert(offset >= 0);
> uint32_t *slmptr = (uint32_t *) (ker->curbe + offset);
> *slmptr = slm_offset;
> @@ -231,7 +231,7 @@ cl_bind_stack(cl_gpgpu gpgpu, cl_kernel ker)
> const int32_t per_lane_stack_sz = ker->stack_size;
> const int32_t value = GBE_CURBE_EXTRA_ARGUMENT;
> const int32_t sub_value = GBE_STACK_BUFFER;
> - const int32_t offset = gbe_kernel_get_curbe_offset(ker->opaque, value, sub_value);
> + const int32_t offset = interp_kernel_get_curbe_offset(ker->opaque, value, sub_value);
> int32_t stack_sz = per_lane_stack_sz;
>
> /* No stack required for this kernel */
> @@ -242,7 +242,7 @@ cl_bind_stack(cl_gpgpu gpgpu, cl_kernel ker)
> * the size we need for the complete machine
> */
> assert(offset >= 0);
> - stack_sz *= gbe_kernel_get_simd_width(ker->opaque);
> + stack_sz *= interp_kernel_get_simd_width(ker->opaque);
> stack_sz *= device->max_compute_unit;
> cl_gpgpu_set_stack(gpgpu, offset, stack_sz, cl_gpgpu_get_cache_ctrl());
> }
> @@ -250,13 +250,13 @@ cl_bind_stack(cl_gpgpu gpgpu, cl_kernel ker)
> static void
> cl_bind_printf(cl_gpgpu gpgpu, cl_kernel ker, void* printf_info, int printf_num, size_t global_sz) {
> int32_t value = GBE_CURBE_PRINTF_INDEX_POINTER;
> - int32_t offset = gbe_kernel_get_curbe_offset(ker->opaque, value, 0);
> + int32_t offset = interp_kernel_get_curbe_offset(ker->opaque, value, 0);
> size_t buf_size = global_sz * sizeof(int) * printf_num;
> cl_gpgpu_set_printf_buffer(gpgpu, 0, buf_size, offset);
>
> value = GBE_CURBE_PRINTF_BUF_POINTER;
> - offset = gbe_kernel_get_curbe_offset(ker->opaque, value, 0);
> - buf_size = gbe_get_printf_sizeof_size(printf_info) * global_sz;
> + offset = interp_kernel_get_curbe_offset(ker->opaque, value, 0);
> + buf_size = interp_get_printf_sizeof_size(printf_info) * global_sz;
> cl_gpgpu_set_printf_buffer(gpgpu, 1, buf_size, offset);
> }
>
> @@ -274,8 +274,8 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
> cl_gpgpu_kernel kernel;
> const uint32_t simd_sz = cl_kernel_get_simd_width(ker);
> size_t i, batch_sz = 0u, local_sz = 0u;
> - size_t cst_sz = ker->curbe_sz= gbe_kernel_get_curbe_size(ker->opaque);
> - int32_t scratch_sz = gbe_kernel_get_scratch_size(ker->opaque);
> + size_t cst_sz = ker->curbe_sz= interp_kernel_get_curbe_size(ker->opaque);
> + int32_t scratch_sz = interp_kernel_get_scratch_size(ker->opaque);
> size_t thread_n = 0u;
> int printf_num = 0;
> cl_int err = CL_SUCCESS;
> @@ -288,7 +288,7 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
> kernel.bo = ker->bo;
> kernel.barrierID = 0;
> kernel.slm_sz = 0;
> - kernel.use_slm = gbe_kernel_use_slm(ker->opaque);
> + kernel.use_slm = interp_kernel_use_slm(ker->opaque);
>
> /* Compute the number of HW threads we need */
> TRY (cl_kernel_work_group_sz, ker, local_wk_sz, 3, &local_sz);
> @@ -314,7 +314,7 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
> }
> }
>
> - printf_info = gbe_dup_printfset(ker->opaque);
> + printf_info = interp_dup_printfset(ker->opaque);
> cl_gpgpu_set_printf_info(gpgpu, printf_info, (size_t *)global_wk_sz);
>
> /* Setup the kernel */
> @@ -323,7 +323,7 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
> else
> cl_gpgpu_state_init(gpgpu, ctx->device->max_compute_unit, cst_sz / 32, 0);
>
> - printf_num = gbe_get_printf_num(printf_info);
> + printf_num = interp_get_printf_num(printf_info);
> if (printf_num) {
> cl_bind_printf(gpgpu, ker, printf_info, printf_num, global_size);
> }
> diff --git a/src/cl_device_id.c b/src/cl_device_id.c
> index c25adf5..51d2e13 100644
> --- a/src/cl_device_id.c
> +++ b/src/cl_device_id.c
> @@ -476,7 +476,7 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,
> DECL_FIELD(PREFERRED_WORK_GROUP_SIZE_MULTIPLE, device->preferred_wg_sz_mul)
> case CL_KERNEL_LOCAL_MEM_SIZE:
> {
> - size_t local_mem_sz = gbe_kernel_get_slm_size(kernel->opaque) + kernel->local_mem_sz;
> + size_t local_mem_sz = interp_kernel_get_slm_size(kernel->opaque) + kernel->local_mem_sz;
> _DECL_FIELD(local_mem_sz)
> }
> DECL_FIELD(COMPILE_WORK_GROUP_SIZE, kernel->compile_wg_sz)
> diff --git a/src/cl_gbe_loader.cpp b/src/cl_gbe_loader.cpp
> index 38f9ab6..56e3445 100644
> --- a/src/cl_gbe_loader.cpp
> +++ b/src/cl_gbe_loader.cpp
> @@ -30,40 +30,40 @@ gbe_kernel_set_const_buffer_size_cb *compiler_kernel_set_const_buffer_size = NUL
> gbe_set_image_base_index_cb *compiler_set_image_base_index = NULL;
>
> //function pointer from libgbeinterp.so
> -gbe_program_new_from_binary_cb *gbe_program_new_from_binary = NULL;
> -gbe_program_get_global_constant_size_cb *gbe_program_get_global_constant_size = NULL;
> -gbe_program_get_global_constant_data_cb *gbe_program_get_global_constant_data = NULL;
> -gbe_program_delete_cb *gbe_program_delete = NULL;
> -gbe_program_get_kernel_num_cb *gbe_program_get_kernel_num = NULL;
> -gbe_program_get_kernel_by_name_cb *gbe_program_get_kernel_by_name = NULL;
> -gbe_program_get_kernel_cb *gbe_program_get_kernel = NULL;
> -gbe_kernel_get_name_cb *gbe_kernel_get_name = NULL;
> -gbe_kernel_get_code_cb *gbe_kernel_get_code = NULL;
> -gbe_kernel_get_code_size_cb *gbe_kernel_get_code_size = NULL;
> -gbe_kernel_get_arg_num_cb *gbe_kernel_get_arg_num = NULL;
> -gbe_kernel_get_arg_size_cb *gbe_kernel_get_arg_size = NULL;
> -gbe_kernel_get_arg_type_cb *gbe_kernel_get_arg_type = NULL;
> -gbe_kernel_get_arg_align_cb *gbe_kernel_get_arg_align = NULL;
> -gbe_kernel_get_simd_width_cb *gbe_kernel_get_simd_width = NULL;
> -gbe_kernel_get_curbe_offset_cb *gbe_kernel_get_curbe_offset = NULL;
> -gbe_kernel_get_curbe_size_cb *gbe_kernel_get_curbe_size = NULL;
> -gbe_kernel_get_stack_size_cb *gbe_kernel_get_stack_size = NULL;
> -gbe_kernel_get_scratch_size_cb *gbe_kernel_get_scratch_size = NULL;
> -gbe_kernel_get_required_work_group_size_cb *gbe_kernel_get_required_work_group_size = NULL;
> -gbe_kernel_use_slm_cb *gbe_kernel_use_slm = NULL;
> -gbe_kernel_get_slm_size_cb *gbe_kernel_get_slm_size = NULL;
> -gbe_kernel_get_sampler_size_cb *gbe_kernel_get_sampler_size = NULL;
> -gbe_kernel_get_sampler_data_cb *gbe_kernel_get_sampler_data = NULL;
> -gbe_kernel_get_compile_wg_size_cb *gbe_kernel_get_compile_wg_size = NULL;
> -gbe_kernel_get_image_size_cb *gbe_kernel_get_image_size = NULL;
> -gbe_kernel_get_image_data_cb *gbe_kernel_get_image_data = NULL;
> -gbe_set_image_base_index_cb *gbe_set_image_base_index_interp = NULL;
> -gbe_get_image_base_index_cb *gbe_get_image_base_index = NULL;
> -gbe_get_printf_num_cb* gbe_get_printf_num = NULL;
> -gbe_dup_printfset_cb* gbe_dup_printfset = NULL;
> -gbe_get_printf_sizeof_size_cb* gbe_get_printf_sizeof_size = NULL;
> -gbe_release_printf_info_cb* gbe_release_printf_info = NULL;
> -gbe_output_printf_cb* gbe_output_printf = NULL;
> +gbe_program_new_from_binary_cb *interp_program_new_from_binary = NULL;
> +gbe_program_get_global_constant_size_cb *interp_program_get_global_constant_size = NULL;
> +gbe_program_get_global_constant_data_cb *interp_program_get_global_constant_data = NULL;
> +gbe_program_delete_cb *interp_program_delete = NULL;
> +gbe_program_get_kernel_num_cb *interp_program_get_kernel_num = NULL;
> +gbe_program_get_kernel_by_name_cb *interp_program_get_kernel_by_name = NULL;
> +gbe_program_get_kernel_cb *interp_program_get_kernel = NULL;
> +gbe_kernel_get_name_cb *interp_kernel_get_name = NULL;
> +gbe_kernel_get_code_cb *interp_kernel_get_code = NULL;
> +gbe_kernel_get_code_size_cb *interp_kernel_get_code_size = NULL;
> +gbe_kernel_get_arg_num_cb *interp_kernel_get_arg_num = NULL;
> +gbe_kernel_get_arg_size_cb *interp_kernel_get_arg_size = NULL;
> +gbe_kernel_get_arg_type_cb *interp_kernel_get_arg_type = NULL;
> +gbe_kernel_get_arg_align_cb *interp_kernel_get_arg_align = NULL;
> +gbe_kernel_get_simd_width_cb *interp_kernel_get_simd_width = NULL;
> +gbe_kernel_get_curbe_offset_cb *interp_kernel_get_curbe_offset = NULL;
> +gbe_kernel_get_curbe_size_cb *interp_kernel_get_curbe_size = NULL;
> +gbe_kernel_get_stack_size_cb *interp_kernel_get_stack_size = NULL;
> +gbe_kernel_get_scratch_size_cb *interp_kernel_get_scratch_size = NULL;
> +gbe_kernel_get_required_work_group_size_cb *interp_kernel_get_required_work_group_size = NULL;
> +gbe_kernel_use_slm_cb *interp_kernel_use_slm = NULL;
> +gbe_kernel_get_slm_size_cb *interp_kernel_get_slm_size = NULL;
> +gbe_kernel_get_sampler_size_cb *interp_kernel_get_sampler_size = NULL;
> +gbe_kernel_get_sampler_data_cb *interp_kernel_get_sampler_data = NULL;
> +gbe_kernel_get_compile_wg_size_cb *interp_kernel_get_compile_wg_size = NULL;
> +gbe_kernel_get_image_size_cb *interp_kernel_get_image_size = NULL;
> +gbe_kernel_get_image_data_cb *interp_kernel_get_image_data = NULL;
> +gbe_set_image_base_index_cb *interp_set_image_base_index = NULL;
> +gbe_get_image_base_index_cb *interp_get_image_base_index = NULL;
> +gbe_get_printf_num_cb* interp_get_printf_num = NULL;
> +gbe_dup_printfset_cb* interp_dup_printfset = NULL;
> +gbe_get_printf_sizeof_size_cb* interp_get_printf_sizeof_size = NULL;
> +gbe_release_printf_info_cb* interp_release_printf_info = NULL;
> +gbe_output_printf_cb* interp_output_printf = NULL;
>
> struct GbeLoaderInitializer
> {
> @@ -84,145 +84,145 @@ struct GbeLoaderInitializer
>
> path = interpPath;
>
> - dlhInterp = dlopen(interpPath, RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
> + dlhInterp = dlopen(interpPath, RTLD_LAZY | RTLD_LOCAL);
> if (dlhInterp == NULL) {
> return false;
> }
>
> - gbe_program_new_from_binary = *(gbe_program_new_from_binary_cb**)dlsym(dlhInterp, "gbe_program_new_from_binary");
> - if (gbe_program_new_from_binary == NULL)
> + interp_program_new_from_binary = *(gbe_program_new_from_binary_cb**)dlsym(dlhInterp, "gbe_program_new_from_binary");
> + if (interp_program_new_from_binary == NULL)
> return false;
>
> - gbe_program_get_global_constant_size = *(gbe_program_get_global_constant_size_cb**)dlsym(dlhInterp, "gbe_program_get_global_constant_size");
> - if (gbe_program_get_global_constant_size == NULL)
> + interp_program_get_global_constant_size = *(gbe_program_get_global_constant_size_cb**)dlsym(dlhInterp, "gbe_program_get_global_constant_size");
> + if (interp_program_get_global_constant_size == NULL)
> return false;
>
> - gbe_program_get_global_constant_data = *(gbe_program_get_global_constant_data_cb**)dlsym(dlhInterp, "gbe_program_get_global_constant_data");
> - if (gbe_program_get_global_constant_data == NULL)
> + interp_program_get_global_constant_data = *(gbe_program_get_global_constant_data_cb**)dlsym(dlhInterp, "gbe_program_get_global_constant_data");
> + if (interp_program_get_global_constant_data == NULL)
> return false;
>
> - gbe_program_delete = *(gbe_program_delete_cb**)dlsym(dlhInterp, "gbe_program_delete");
> - if (gbe_program_delete == NULL)
> + interp_program_delete = *(gbe_program_delete_cb**)dlsym(dlhInterp, "gbe_program_delete");
> + if (interp_program_delete == NULL)
> return false;
>
> - gbe_program_get_kernel_num = *(gbe_program_get_kernel_num_cb**)dlsym(dlhInterp, "gbe_program_get_kernel_num");
> - if (gbe_program_get_kernel_num == NULL)
> + interp_program_get_kernel_num = *(gbe_program_get_kernel_num_cb**)dlsym(dlhInterp, "gbe_program_get_kernel_num");
> + if (interp_program_get_kernel_num == NULL)
> return false;
>
> - gbe_program_get_kernel_by_name = *(gbe_program_get_kernel_by_name_cb**)dlsym(dlhInterp, "gbe_program_get_kernel_by_name");
> - if (gbe_program_get_kernel_by_name == NULL)
> + interp_program_get_kernel_by_name = *(gbe_program_get_kernel_by_name_cb**)dlsym(dlhInterp, "gbe_program_get_kernel_by_name");
> + if (interp_program_get_kernel_by_name == NULL)
> return false;
>
> - gbe_program_get_kernel = *(gbe_program_get_kernel_cb**)dlsym(dlhInterp, "gbe_program_get_kernel");
> - if (gbe_program_get_kernel == NULL)
> + interp_program_get_kernel = *(gbe_program_get_kernel_cb**)dlsym(dlhInterp, "gbe_program_get_kernel");
> + if (interp_program_get_kernel == NULL)
> return false;
>
> - gbe_kernel_get_name = *(gbe_kernel_get_name_cb**)dlsym(dlhInterp, "gbe_kernel_get_name");
> - if (gbe_kernel_get_name == NULL)
> + interp_kernel_get_name = *(gbe_kernel_get_name_cb**)dlsym(dlhInterp, "gbe_kernel_get_name");
> + if (interp_kernel_get_name == NULL)
> return false;
>
> - gbe_kernel_get_code = *(gbe_kernel_get_code_cb**)dlsym(dlhInterp, "gbe_kernel_get_code");
> - if (gbe_kernel_get_code == NULL)
> + interp_kernel_get_code = *(gbe_kernel_get_code_cb**)dlsym(dlhInterp, "gbe_kernel_get_code");
> + if (interp_kernel_get_code == NULL)
> return false;
>
> - gbe_kernel_get_code_size = *(gbe_kernel_get_code_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_code_size");
> - if (gbe_kernel_get_code_size == NULL)
> + interp_kernel_get_code_size = *(gbe_kernel_get_code_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_code_size");
> + if (interp_kernel_get_code_size == NULL)
> return false;
>
> - gbe_kernel_get_arg_num = *(gbe_kernel_get_arg_num_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_num");
> - if (gbe_kernel_get_arg_num == NULL)
> + interp_kernel_get_arg_num = *(gbe_kernel_get_arg_num_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_num");
> + if (interp_kernel_get_arg_num == NULL)
> return false;
>
> - gbe_kernel_get_arg_size = *(gbe_kernel_get_arg_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_size");
> - if (gbe_kernel_get_arg_size == NULL)
> + interp_kernel_get_arg_size = *(gbe_kernel_get_arg_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_size");
> + if (interp_kernel_get_arg_size == NULL)
> return false;
>
> - gbe_kernel_get_arg_type = *(gbe_kernel_get_arg_type_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_type");
> - if (gbe_kernel_get_arg_type == NULL)
> + interp_kernel_get_arg_type = *(gbe_kernel_get_arg_type_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_type");
> + if (interp_kernel_get_arg_type == NULL)
> return false;
>
> - gbe_kernel_get_arg_align = *(gbe_kernel_get_arg_align_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_align");
> - if (gbe_kernel_get_arg_align == NULL)
> + interp_kernel_get_arg_align = *(gbe_kernel_get_arg_align_cb**)dlsym(dlhInterp, "gbe_kernel_get_arg_align");
> + if (interp_kernel_get_arg_align == NULL)
> return false;
>
> - gbe_kernel_get_simd_width = *(gbe_kernel_get_simd_width_cb**)dlsym(dlhInterp, "gbe_kernel_get_simd_width");
> - if (gbe_kernel_get_simd_width == NULL)
> + interp_kernel_get_simd_width = *(gbe_kernel_get_simd_width_cb**)dlsym(dlhInterp, "gbe_kernel_get_simd_width");
> + if (interp_kernel_get_simd_width == NULL)
> return false;
>
> - gbe_kernel_get_curbe_offset = *(gbe_kernel_get_curbe_offset_cb**)dlsym(dlhInterp, "gbe_kernel_get_curbe_offset");
> - if (gbe_kernel_get_curbe_offset == NULL)
> + interp_kernel_get_curbe_offset = *(gbe_kernel_get_curbe_offset_cb**)dlsym(dlhInterp, "gbe_kernel_get_curbe_offset");
> + if (interp_kernel_get_curbe_offset == NULL)
> return false;
>
> - gbe_kernel_get_curbe_size = *(gbe_kernel_get_curbe_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_curbe_size");
> - if (gbe_kernel_get_curbe_size == NULL)
> + interp_kernel_get_curbe_size = *(gbe_kernel_get_curbe_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_curbe_size");
> + if (interp_kernel_get_curbe_size == NULL)
> return false;
>
> - gbe_kernel_get_stack_size = *(gbe_kernel_get_stack_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_stack_size");
> - if (gbe_kernel_get_stack_size == NULL)
> + interp_kernel_get_stack_size = *(gbe_kernel_get_stack_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_stack_size");
> + if (interp_kernel_get_stack_size == NULL)
> return false;
>
> - gbe_kernel_get_scratch_size = *(gbe_kernel_get_scratch_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_scratch_size");
> - if (gbe_kernel_get_scratch_size == NULL)
> + interp_kernel_get_scratch_size = *(gbe_kernel_get_scratch_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_scratch_size");
> + if (interp_kernel_get_scratch_size == NULL)
> return false;
>
> - gbe_kernel_get_required_work_group_size = *(gbe_kernel_get_required_work_group_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_required_work_group_size");
> - if (gbe_kernel_get_required_work_group_size == NULL)
> + interp_kernel_get_required_work_group_size = *(gbe_kernel_get_required_work_group_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_required_work_group_size");
> + if (interp_kernel_get_required_work_group_size == NULL)
> return false;
>
> - gbe_kernel_use_slm = *(gbe_kernel_use_slm_cb**)dlsym(dlhInterp, "gbe_kernel_use_slm");
> - if (gbe_kernel_use_slm == NULL)
> + interp_kernel_use_slm = *(gbe_kernel_use_slm_cb**)dlsym(dlhInterp, "gbe_kernel_use_slm");
> + if (interp_kernel_use_slm == NULL)
> return false;
>
> - gbe_kernel_get_slm_size = *(gbe_kernel_get_slm_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_slm_size");
> - if (gbe_kernel_get_slm_size == NULL)
> + interp_kernel_get_slm_size = *(gbe_kernel_get_slm_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_slm_size");
> + if (interp_kernel_get_slm_size == NULL)
> return false;
>
> - gbe_kernel_get_sampler_size = *(gbe_kernel_get_sampler_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_sampler_size");
> - if (gbe_kernel_get_sampler_size == NULL)
> + interp_kernel_get_sampler_size = *(gbe_kernel_get_sampler_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_sampler_size");
> + if (interp_kernel_get_sampler_size == NULL)
> return false;
>
> - gbe_kernel_get_sampler_data = *(gbe_kernel_get_sampler_data_cb**)dlsym(dlhInterp, "gbe_kernel_get_sampler_data");
> - if (gbe_kernel_get_sampler_data == NULL)
> + interp_kernel_get_sampler_data = *(gbe_kernel_get_sampler_data_cb**)dlsym(dlhInterp, "gbe_kernel_get_sampler_data");
> + if (interp_kernel_get_sampler_data == NULL)
> return false;
>
> - gbe_kernel_get_compile_wg_size = *(gbe_kernel_get_compile_wg_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_compile_wg_size");
> - if (gbe_kernel_get_compile_wg_size == NULL)
> + interp_kernel_get_compile_wg_size = *(gbe_kernel_get_compile_wg_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_compile_wg_size");
> + if (interp_kernel_get_compile_wg_size == NULL)
> return false;
>
> - gbe_kernel_get_image_size = *(gbe_kernel_get_image_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_image_size");
> - if (gbe_kernel_get_image_size == NULL)
> + interp_kernel_get_image_size = *(gbe_kernel_get_image_size_cb**)dlsym(dlhInterp, "gbe_kernel_get_image_size");
> + if (interp_kernel_get_image_size == NULL)
> return false;
>
> - gbe_kernel_get_image_data = *(gbe_kernel_get_image_data_cb**)dlsym(dlhInterp, "gbe_kernel_get_image_data");
> - if (gbe_kernel_get_image_data == NULL)
> + interp_kernel_get_image_data = *(gbe_kernel_get_image_data_cb**)dlsym(dlhInterp, "gbe_kernel_get_image_data");
> + if (interp_kernel_get_image_data == NULL)
> return false;
>
> - gbe_set_image_base_index_interp = *(gbe_set_image_base_index_cb**)dlsym(dlhInterp, "gbe_set_image_base_index");
> - if (gbe_set_image_base_index_interp == NULL)
> + interp_set_image_base_index = *(gbe_set_image_base_index_cb**)dlsym(dlhInterp, "gbe_set_image_base_index");
> + if (interp_set_image_base_index == NULL)
> return false;
>
> - gbe_get_image_base_index = *(gbe_get_image_base_index_cb**)dlsym(dlhInterp, "gbe_get_image_base_index");
> - if (gbe_get_image_base_index == NULL)
> + interp_get_image_base_index = *(gbe_get_image_base_index_cb**)dlsym(dlhInterp, "gbe_get_image_base_index");
> + if (interp_get_image_base_index == NULL)
> return false;
>
> - gbe_get_printf_num = *(gbe_get_printf_num_cb**)dlsym(dlhInterp, "gbe_get_printf_num");
> - if (gbe_get_printf_num == NULL)
> + interp_get_printf_num = *(gbe_get_printf_num_cb**)dlsym(dlhInterp, "gbe_get_printf_num");
> + if (interp_get_printf_num == NULL)
> return false;
>
> - gbe_dup_printfset = *(gbe_dup_printfset_cb**)dlsym(dlhInterp, "gbe_dup_printfset");
> - if (gbe_dup_printfset == NULL)
> + interp_dup_printfset = *(gbe_dup_printfset_cb**)dlsym(dlhInterp, "gbe_dup_printfset");
> + if (interp_dup_printfset == NULL)
> return false;
>
> - gbe_get_printf_sizeof_size = *(gbe_get_printf_sizeof_size_cb**)dlsym(dlhInterp, "gbe_get_printf_sizeof_size");
> - if (gbe_get_printf_sizeof_size == NULL)
> + interp_get_printf_sizeof_size = *(gbe_get_printf_sizeof_size_cb**)dlsym(dlhInterp, "gbe_get_printf_sizeof_size");
> + if (interp_get_printf_sizeof_size == NULL)
> return false;
>
> - gbe_release_printf_info = *(gbe_release_printf_info_cb**)dlsym(dlhInterp, "gbe_release_printf_info");
> - if (gbe_release_printf_info == NULL)
> + interp_release_printf_info = *(gbe_release_printf_info_cb**)dlsym(dlhInterp, "gbe_release_printf_info");
> + if (interp_release_printf_info == NULL)
> return false;
>
> - gbe_output_printf = *(gbe_output_printf_cb**)dlsym(dlhInterp, "gbe_output_printf");
> - if (gbe_output_printf == NULL)
> + interp_output_printf = *(gbe_output_printf_cb**)dlsym(dlhInterp, "gbe_output_printf");
> + if (interp_output_printf == NULL)
> return false;
>
> return true;
> diff --git a/src/cl_gbe_loader.h b/src/cl_gbe_loader.h
> index f97f296..93da91c 100644
> --- a/src/cl_gbe_loader.h
> +++ b/src/cl_gbe_loader.h
> @@ -29,7 +29,42 @@ extern gbe_program_serialize_to_binary_cb *compiler_program_serialize_to_binary;
> extern gbe_program_new_from_llvm_cb *compiler_program_new_from_llvm;
> extern gbe_kernel_set_const_buffer_size_cb *compiler_kernel_set_const_buffer_size;
> extern gbe_set_image_base_index_cb *compiler_set_image_base_index;
> -extern gbe_set_image_base_index_cb *gbe_set_image_base_index_interp;
> +
> +extern gbe_program_new_from_binary_cb *interp_program_new_from_binary;
> +extern gbe_program_get_global_constant_size_cb *interp_program_get_global_constant_size;
> +extern gbe_program_get_global_constant_data_cb *interp_program_get_global_constant_data;
> +extern gbe_program_delete_cb *interp_program_delete;
> +extern gbe_program_get_kernel_num_cb *interp_program_get_kernel_num;
> +extern gbe_program_get_kernel_by_name_cb *interp_program_get_kernel_by_name;
> +extern gbe_program_get_kernel_cb *interp_program_get_kernel;
> +extern gbe_kernel_get_name_cb *interp_kernel_get_name;
> +extern gbe_kernel_get_code_cb *interp_kernel_get_code;
> +extern gbe_kernel_get_code_size_cb *interp_kernel_get_code_size;
> +extern gbe_kernel_get_arg_num_cb *interp_kernel_get_arg_num;
> +extern gbe_kernel_get_arg_size_cb *interp_kernel_get_arg_size;
> +extern gbe_kernel_get_arg_type_cb *interp_kernel_get_arg_type;
> +extern gbe_kernel_get_arg_align_cb *interp_kernel_get_arg_align;
> +extern gbe_kernel_get_simd_width_cb *interp_kernel_get_simd_width;
> +extern gbe_kernel_get_curbe_offset_cb *interp_kernel_get_curbe_offset;
> +extern gbe_kernel_get_curbe_size_cb *interp_kernel_get_curbe_size;
> +extern gbe_kernel_get_stack_size_cb *interp_kernel_get_stack_size;
> +extern gbe_kernel_get_scratch_size_cb *interp_kernel_get_scratch_size;
> +extern gbe_kernel_get_required_work_group_size_cb *interp_kernel_get_required_work_group_size;
> +extern gbe_kernel_use_slm_cb *interp_kernel_use_slm;
> +extern gbe_kernel_get_slm_size_cb *interp_kernel_get_slm_size;
> +extern gbe_kernel_get_sampler_size_cb *interp_kernel_get_sampler_size;
> +extern gbe_kernel_get_sampler_data_cb *interp_kernel_get_sampler_data;
> +extern gbe_kernel_get_compile_wg_size_cb *interp_kernel_get_compile_wg_size;
> +extern gbe_kernel_get_image_size_cb *interp_kernel_get_image_size;
> +extern gbe_kernel_get_image_data_cb *interp_kernel_get_image_data;
> +extern gbe_set_image_base_index_cb *interp_set_image_base_index;
> +extern gbe_get_image_base_index_cb *interp_get_image_base_index;
> +extern gbe_get_printf_num_cb* interp_get_printf_num;
> +extern gbe_dup_printfset_cb* interp_dup_printfset;
> +extern gbe_get_printf_sizeof_size_cb* interp_get_printf_sizeof_size;
> +extern gbe_release_printf_info_cb* interp_release_printf_info;
> +extern gbe_output_printf_cb* interp_output_printf;
> +
> int CompilerSupported();
> #ifdef __cplusplus
> }
> diff --git a/src/cl_kernel.c b/src/cl_kernel.c
> index a45e281..5fc3e44 100644
> --- a/src/cl_kernel.c
> +++ b/src/cl_kernel.c
> @@ -83,7 +83,7 @@ LOCAL const char*
> cl_kernel_get_name(cl_kernel k)
> {
> if (UNLIKELY(k == NULL)) return NULL;
> - return gbe_kernel_get_name(k->opaque);
> + return interp_kernel_get_name(k->opaque);
> }
>
> LOCAL void
> @@ -102,8 +102,8 @@ cl_kernel_set_arg(cl_kernel k, cl_uint index, size_t sz, const void *value)
>
> if (UNLIKELY(index >= k->arg_n))
> return CL_INVALID_ARG_INDEX;
> - arg_type = gbe_kernel_get_arg_type(k->opaque, index);
> - arg_sz = gbe_kernel_get_arg_size(k->opaque, index);
> + arg_type = interp_kernel_get_arg_type(k->opaque, index);
> + arg_sz = interp_kernel_get_arg_size(k->opaque, index);
>
> if (UNLIKELY(arg_type != GBE_ARG_LOCAL_PTR && arg_sz != sz)) {
> if (arg_sz == 2 && arg_type == GBE_ARG_VALUE && sz == sizeof(cl_sampler)) {
> @@ -147,7 +147,7 @@ cl_kernel_set_arg(cl_kernel k, cl_uint index, size_t sz, const void *value)
>
> /* Copy the structure or the value directly into the curbe */
> if (arg_type == GBE_ARG_VALUE) {
> - offset = gbe_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> + offset = interp_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> assert(offset + sz <= k->curbe_sz);
> memcpy(k->curbe + offset, value, sz);
> k->args[index].local_sz = 0;
> @@ -173,7 +173,7 @@ cl_kernel_set_arg(cl_kernel k, cl_uint index, size_t sz, const void *value)
> k->args[index].mem = NULL;
> k->args[index].sampler = sampler;
> cl_set_sampler_arg_slot(k, index, sampler);
> - offset = gbe_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> + offset = interp_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> assert(offset + 2 <= k->curbe_sz);
> memcpy(k->curbe + offset, &sampler->clkSamplerValue, 2);
> return CL_SUCCESS;
> @@ -184,7 +184,7 @@ cl_kernel_set_arg(cl_kernel k, cl_uint index, size_t sz, const void *value)
>
> if(value == NULL || mem == NULL) {
> /* for buffer object GLOBAL_PTR CONSTANT_PTR, it maybe NULL */
> - int32_t offset = gbe_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> + int32_t offset = interp_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, index);
> *((uint32_t *)(k->curbe + offset)) = 0;
> assert(arg_type == GBE_ARG_GLOBAL_PTR || arg_type == GBE_ARG_CONSTANT_PTR);
>
> @@ -212,7 +212,7 @@ LOCAL uint32_t
> cl_kernel_get_simd_width(cl_kernel k)
> {
> assert(k != NULL);
> - return gbe_kernel_get_simd_width(k->opaque);
> + return interp_kernel_get_simd_width(k->opaque);
> }
>
> LOCAL void
> @@ -225,31 +225,31 @@ cl_kernel_setup(cl_kernel k, gbe_kernel opaque)
> cl_buffer_unreference(k->bo);
>
> /* Allocate the gen code here */
> - const uint32_t code_sz = gbe_kernel_get_code_size(opaque);
> - const char *code = gbe_kernel_get_code(opaque);
> + const uint32_t code_sz = interp_kernel_get_code_size(opaque);
> + const char *code = interp_kernel_get_code(opaque);
> k->bo = cl_buffer_alloc(bufmgr, "CL kernel", code_sz, 64u);
> - k->arg_n = gbe_kernel_get_arg_num(opaque);
> + k->arg_n = interp_kernel_get_arg_num(opaque);
>
> /* Upload the code */
> cl_buffer_subdata(k->bo, 0, code_sz, code);
> k->opaque = opaque;
>
> /* Create the curbe */
> - k->curbe_sz = gbe_kernel_get_curbe_size(k->opaque);
> + k->curbe_sz = interp_kernel_get_curbe_size(k->opaque);
>
> /* Get sampler data & size */
> - k->sampler_sz = gbe_kernel_get_sampler_size(k->opaque);
> + k->sampler_sz = interp_kernel_get_sampler_size(k->opaque);
> assert(k->sampler_sz <= GEN_MAX_SAMPLERS);
> if (k->sampler_sz > 0)
> - gbe_kernel_get_sampler_data(k->opaque, k->samplers);
> - gbe_kernel_get_compile_wg_size(k->opaque, k->compile_wg_sz);
> - k->stack_size = gbe_kernel_get_stack_size(k->opaque);
> + interp_kernel_get_sampler_data(k->opaque, k->samplers);
> + interp_kernel_get_compile_wg_size(k->opaque, k->compile_wg_sz);
> + k->stack_size = interp_kernel_get_stack_size(k->opaque);
> /* Get image data & size */
> - k->image_sz = gbe_kernel_get_image_size(k->opaque);
> + k->image_sz = interp_kernel_get_image_size(k->opaque);
> assert(k->sampler_sz <= GEN_MAX_SURFACES);
> if (k->image_sz > 0) {
> TRY_ALLOC_NO_ERR(k->images, cl_calloc(k->image_sz, sizeof(k->images[0])));
> - gbe_kernel_get_image_data(k->opaque, k->images);
> + interp_kernel_get_image_data(k->opaque, k->images);
> } else
> k->images = NULL;
> return;
> @@ -317,7 +317,7 @@ cl_kernel_work_group_sz(cl_kernel ker,
> cl_uint i;
>
> for (i = 0; i < wk_dim; ++i) {
> - const uint32_t required_sz = gbe_kernel_get_required_work_group_size(ker->opaque, i);
> + const uint32_t required_sz = interp_kernel_get_required_work_group_size(ker->opaque, i);
> if (required_sz != 0 && required_sz != local_wk_sz[i]) {
> err = CL_INVALID_WORK_ITEM_SIZE;
> goto error;
> diff --git a/src/cl_program.c b/src/cl_program.c
> index 42058e8..41bf67a 100644
> --- a/src/cl_program.c
> +++ b/src/cl_program.c
> @@ -93,7 +93,7 @@ cl_program_delete(cl_program p)
> cl_context_delete(p->ctx);
>
> /* Free the program as allocated by the compiler */
> - if (p->opaque) gbe_program_delete(p->opaque);
> + if (p->opaque) interp_program_delete(p->opaque);
>
> p->magic = CL_MAGIC_DEAD_HEADER; /* For safety */
> cl_free(p);
> @@ -137,13 +137,13 @@ cl_program_load_gen_program(cl_program p)
> uint32_t i;
>
> assert(p->opaque != NULL);
> - p->ker_n = gbe_program_get_kernel_num(p->opaque);
> + p->ker_n = interp_program_get_kernel_num(p->opaque);
>
> /* Allocate the kernel array */
> TRY_ALLOC (p->ker, CALLOC_ARRAY(cl_kernel, p->ker_n));
>
> for (i = 0; i < p->ker_n; ++i) {
> - const gbe_kernel opaque = gbe_program_get_kernel(p->opaque, i);
> + const gbe_kernel opaque = interp_program_get_kernel(p->opaque, i);
> assert(opaque != NULL);
> TRY_ALLOC (p->ker[i], cl_kernel_new(p));
> cl_kernel_setup(p->ker[i], opaque);
> @@ -345,7 +345,7 @@ cl_program_build(cl_program p, const char *options)
> TRY (cl_program_load_gen_program, p);
> p->source_type = FROM_LLVM;
> } else if (p->source_type == FROM_BINARY) {
> - p->opaque = gbe_program_new_from_binary(p->ctx->device->vendor_id, p->binary, p->binary_sz);
> + p->opaque = interp_program_new_from_binary(p->ctx->device->vendor_id, p->binary, p->binary_sz);
> if (UNLIKELY(p->opaque == NULL)) {
> err = CL_BUILD_PROGRAM_FAILURE;
> goto error;
> @@ -357,16 +357,16 @@ cl_program_build(cl_program p, const char *options)
> }
>
> for (i = 0; i < p->ker_n; i ++) {
> - const gbe_kernel opaque = gbe_program_get_kernel(p->opaque, i);
> - p->bin_sz += gbe_kernel_get_code_size(opaque);
> + const gbe_kernel opaque = interp_program_get_kernel(p->opaque, i);
> + p->bin_sz += interp_kernel_get_code_size(opaque);
> }
>
> TRY_ALLOC (p->bin, cl_calloc(p->bin_sz, sizeof(char)));
> for (i = 0; i < p->ker_n; i ++) {
> - const gbe_kernel opaque = gbe_program_get_kernel(p->opaque, i);
> - size_t sz = gbe_kernel_get_code_size(opaque);
> + const gbe_kernel opaque = interp_program_get_kernel(p->opaque, i);
> + size_t sz = interp_kernel_get_code_size(opaque);
>
> - memcpy(p->bin + copyed, gbe_kernel_get_code(opaque), sz);
> + memcpy(p->bin + copyed, interp_kernel_get_code(opaque), sz);
> copyed += sz;
> }
>
> diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
> index bc6aaef..f0e860c 100644
> --- a/src/intel/intel_driver.c
> +++ b/src/intel/intel_driver.c
> @@ -412,7 +412,7 @@ cl_intel_driver_new(cl_context_prop props)
> * when it allocates slots for images*/
> if (CompilerSupported())
> compiler_set_image_base_index(3);
> - gbe_set_image_base_index_interp(3);
> + interp_set_image_base_index(3);
> exit:
> return driver;
> error:
More information about the Beignet
mailing list