[Beignet] [PATCH 1/2] GBE: cleanup image base index related code.

Zhigang Gong zhigang.gong at intel.com
Wed Jul 30 01:06:17 PDT 2014


Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 backend/src/backend/program.cpp     | 13 -------------
 backend/src/gbe_bin_generater.cpp   |  2 --
 backend/src/gbe_bin_interpreter.cpp |  2 --
 src/cl_gbe_loader.cpp               | 15 ---------------
 src/cl_gbe_loader.h                 |  4 ----
 src/intel/intel_driver.c            |  6 ------
 6 files changed, 42 deletions(-)

diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index c7570de..50396c8 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -1151,15 +1151,6 @@ namespace gbe {
     kernel->getImageData(images);
   }
 
-  static uint32_t gbeImageBaseIndex = 0;
-  static void setImageBaseIndex(uint32_t baseIdx) {
-     gbeImageBaseIndex = baseIdx;
-  }
-
-  static uint32_t getImageBaseIndex() {
-    return gbeImageBaseIndex;
-  }
-
   static uint32_t kernelGetRequiredWorkGroupSize(gbe_kernel kernel, uint32_t dim) {
     return 0u;
   }
@@ -1215,8 +1206,6 @@ GBE_EXPORT_SYMBOL gbe_kernel_get_sampler_data_cb *gbe_kernel_get_sampler_data =
 GBE_EXPORT_SYMBOL gbe_kernel_get_compile_wg_size_cb *gbe_kernel_get_compile_wg_size = NULL;
 GBE_EXPORT_SYMBOL gbe_kernel_get_image_size_cb *gbe_kernel_get_image_size = NULL;
 GBE_EXPORT_SYMBOL gbe_kernel_get_image_data_cb *gbe_kernel_get_image_data = NULL;
-GBE_EXPORT_SYMBOL gbe_set_image_base_index_cb *gbe_set_image_base_index = NULL;
-GBE_EXPORT_SYMBOL gbe_get_image_base_index_cb *gbe_get_image_base_index = NULL;
 GBE_EXPORT_SYMBOL gbe_get_printf_num_cb *gbe_get_printf_num = NULL;
 GBE_EXPORT_SYMBOL gbe_dup_printfset_cb *gbe_dup_printfset = NULL;
 GBE_EXPORT_SYMBOL gbe_get_printf_buf_bti_cb *gbe_get_printf_buf_bti = NULL;
@@ -1264,8 +1253,6 @@ namespace gbe
       gbe_kernel_get_compile_wg_size = gbe::kernelGetCompileWorkGroupSize;
       gbe_kernel_get_image_size = gbe::kernelGetImageSize;
       gbe_kernel_get_image_data = gbe::kernelGetImageData;
-      gbe_get_image_base_index = gbe::getImageBaseIndex;
-      gbe_set_image_base_index = gbe::setImageBaseIndex;
       gbe_get_printf_num = gbe::kernelGetPrintfNum;
       gbe_get_printf_buf_bti = gbe::kernelGetPrintfBufBTI;
       gbe_get_printf_indexbuf_bti = gbe::kernelGetPrintfIndexBufBTI;
diff --git a/backend/src/gbe_bin_generater.cpp b/backend/src/gbe_bin_generater.cpp
index 86c4406..79e3935 100644
--- a/backend/src/gbe_bin_generater.cpp
+++ b/backend/src/gbe_bin_generater.cpp
@@ -366,8 +366,6 @@ int main (int argc, const char **argv)
             str >> std::hex >> gen_pci_id;
 
             used_index[optind-1] = 1;
-            // We must set the image base index here, as we invoke the backend in a non-standard way.
-            gbe_set_image_base_index(3);
             break;
         }
 
diff --git a/backend/src/gbe_bin_interpreter.cpp b/backend/src/gbe_bin_interpreter.cpp
index ffca1f5..ecf62b1 100644
--- a/backend/src/gbe_bin_interpreter.cpp
+++ b/backend/src/gbe_bin_interpreter.cpp
@@ -63,8 +63,6 @@ struct BinInterpCallBackInitializer
     gbe_kernel_get_sampler_data = gbe::kernelGetSamplerData;
     gbe_kernel_get_image_data = gbe::kernelGetImageData;
     gbe_kernel_get_arg_info = gbe::kernelGetArgInfo;
-    gbe_get_image_base_index = gbe::getImageBaseIndex;
-    gbe_set_image_base_index = gbe::setImageBaseIndex;
     gbe_get_printf_num = gbe::kernelGetPrintfNum;
     gbe_get_printf_buf_bti = gbe::kernelGetPrintfBufBTI;
     gbe_get_printf_indexbuf_bti = gbe::kernelGetPrintfIndexBufBTI;
diff --git a/src/cl_gbe_loader.cpp b/src/cl_gbe_loader.cpp
index 9d609c7..c95eb7c 100644
--- a/src/cl_gbe_loader.cpp
+++ b/src/cl_gbe_loader.cpp
@@ -31,7 +31,6 @@ gbe_program_build_from_llvm_cb *compiler_program_build_from_llvm = NULL;
 gbe_program_new_from_llvm_binary_cb *compiler_program_new_from_llvm_binary = NULL;
 gbe_program_serialize_to_binary_cb *compiler_program_serialize_to_binary = NULL;
 gbe_program_new_from_llvm_cb *compiler_program_new_from_llvm = NULL;
-gbe_set_image_base_index_cb *compiler_set_image_base_index = NULL;
 gbe_program_clean_llvm_resource_cb *compiler_program_clean_llvm_resource = NULL;
 
 //function pointer from libgbeinterp.so
@@ -63,8 +62,6 @@ 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_get_printf_buf_bti_cb* interp_get_printf_buf_bti = NULL;
 gbe_get_printf_indexbuf_bti_cb* interp_get_printf_indexbuf_bti = NULL;
@@ -210,14 +207,6 @@ struct GbeLoaderInitializer
     if (interp_kernel_get_image_data == NULL)
       return false;
 
-    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;
-
-    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;
-
     interp_get_printf_num = *(gbe_get_printf_num_cb**)dlsym(dlhInterp, "gbe_get_printf_num");
     if (interp_get_printf_num == NULL)
       return false;
@@ -301,10 +290,6 @@ struct GbeLoaderInitializer
       if (compiler_program_new_from_llvm == NULL)
         return;
 
-      compiler_set_image_base_index = *(gbe_set_image_base_index_cb **)dlsym(dlhCompiler, "gbe_set_image_base_index");
-      if (compiler_set_image_base_index == NULL)
-        return;
-
       compiler_program_clean_llvm_resource = *(gbe_program_clean_llvm_resource_cb **)dlsym(dlhCompiler, "gbe_program_clean_llvm_resource");
       if (compiler_program_clean_llvm_resource == NULL)
         return;
diff --git a/src/cl_gbe_loader.h b/src/cl_gbe_loader.h
index 6cbc99e..38b43b7 100644
--- a/src/cl_gbe_loader.h
+++ b/src/cl_gbe_loader.h
@@ -32,7 +32,6 @@ extern gbe_program_build_from_llvm_cb *compiler_program_build_from_llvm;
 extern gbe_program_new_from_llvm_binary_cb *compiler_program_new_from_llvm_binary;
 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_set_image_base_index_cb *compiler_set_image_base_index;
 extern gbe_program_clean_llvm_resource_cb *compiler_program_clean_llvm_resource;
 
 extern gbe_program_new_from_binary_cb *interp_program_new_from_binary;
@@ -63,8 +62,6 @@ 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_get_printf_buf_bti_cb* interp_get_printf_buf_bti;
 extern gbe_get_printf_indexbuf_bti_cb* interp_get_printf_indexbuf_bti;
@@ -72,7 +69,6 @@ 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;
-//extern gbe_set_image_base_index_cb *gbe_set_image_base_index_interp;
 extern gbe_kernel_get_arg_info_cb *interp_kernel_get_arg_info;
 
 int CompilerSupported();
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index 7c9f5d8..3cef2f8 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -427,12 +427,6 @@ cl_intel_driver_new(cl_context_prop props)
   intel_driver_t *driver = NULL;
   TRY_ALLOC_NO_ERR (driver, intel_driver_new());
   intel_driver_open(driver, props);
-  /* We use the first 2 slots(0,1) for all the bufs.
-   * Notify the gbe this base index, thus gbe can avoid conflicts
-   * when it allocates slots for images*/
-  if (CompilerSupported())
-    compiler_set_image_base_index(3);
-  interp_set_image_base_index(3);
 exit:
   return driver;
 error:
-- 
1.8.3.2



More information about the Beignet mailing list