[Beignet] [PATCH] clean code to remove gbe_kernel_set_const_buffer_size
Song, Ruiling
ruiling.song at intel.com
Thu Jun 12 19:05:53 PDT 2014
LGTM
-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Guo Yejun
Sent: Friday, June 13, 2014 2:14 AM
To: beignet at lists.freedesktop.org
Cc: Guo, Yejun
Subject: [Beignet] [PATCH] clean code to remove gbe_kernel_set_const_buffer_size
this function is no longer needed.
Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
backend/src/backend/context.cpp | 21 --------------------- backend/src/backend/context.hpp | 2 -- backend/src/backend/program.cpp | 8 --------
backend/src/backend/program.h | 4 ----
backend/src/backend/program.hpp | 12 ------------
src/cl_gbe_loader.cpp | 6 ------
src/cl_gbe_loader.h | 1 -
7 files changed, 54 deletions(-)
diff --git a/backend/src/backend/context.cpp b/backend/src/backend/context.cpp index db968c3..5fe39a9 100644
--- a/backend/src/backend/context.cpp
+++ b/backend/src/backend/context.cpp
@@ -381,27 +381,6 @@ namespace gbe
registerAllocator->splitBlock(offset, subOffset);
}
- int32_t Context::allocConstBuf(uint32_t argID) {
- GBE_ASSERT(kernel->args[argID].type == GBE_ARG_CONSTANT_PTR);
-
- //free previous
- int32_t offset = kernel->getCurbeOffset(GBE_CURBE_EXTRA_ARGUMENT, argID+GBE_CONSTANT_BUFFER);
- if(offset >= 0)
- deallocate(offset+GEN_REG_SIZE);
-
- if(kernel->args[argID].bufSize > 0) {
- //use 32 alignment here as GEN_REG_SIZE, need dynamic by type?
- newCurbeEntry(GBE_CURBE_EXTRA_ARGUMENT, GBE_CONSTANT_BUFFER+argID, kernel->args[argID].bufSize, 32);
- }
-
- std::sort(kernel->patches.begin(), kernel->patches.end());
- offset = kernel->getCurbeOffset(GBE_CURBE_EXTRA_ARGUMENT, argID+GBE_CONSTANT_BUFFER);
- GBE_ASSERT(offset>=0);
-
- kernel->curbeSize = ALIGN(kernel->curbeSize, GEN_REG_SIZE);
- return offset + GEN_REG_SIZE;
- }
-
// FIXME TODO as we optimize scratch memory usage using the register interval.
// we need to add some dependency in post_reg_alloc scheduler, to keep scratch
// memory that are reused still keep the order diff --git a/backend/src/backend/context.hpp b/backend/src/backend/context.hpp index 2a37a0e..3d3c6d4 100644
--- a/backend/src/backend/context.hpp
+++ b/backend/src/backend/context.hpp
@@ -89,8 +89,6 @@ namespace gbe
void deallocate(int16_t offset);
/*! Spilt a block into 2 blocks, for some registers allocate together but deallocate seperate */
void splitBlock(int16_t offset, int16_t subOffset);
- /* allocate curbe for constant ptr argument */
- int32_t allocConstBuf(uint32_t argID);
/* allocate a new entry for a specific image's information */
/*! Get (search or allocate if fail to find one) image info curbeOffset.*/
uint32_t getImageInfoCurbeOffset(ir::ImageInfoKey key, size_t size); diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp index e64e624..2de4b63 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -977,12 +977,6 @@ namespace gbe {
return kernel->getSLMSize();
}
- static int32_t kernelSetConstBufSize(gbe_kernel genKernel, uint32_t argID, size_t sz) {
- if (genKernel == NULL) return -1;
- gbe::Kernel *kernel = (gbe::Kernel*) genKernel;
- return kernel->setConstBufSize(argID, sz);
- }
-
static size_t kernelGetSamplerSize(gbe_kernel gbeKernel) {
if (gbeKernel == NULL) return 0;
const gbe::Kernel *kernel = (const gbe::Kernel*) gbeKernel; @@ -1083,7 +1077,6 @@ GBE_EXPORT_SYMBOL gbe_kernel_get_curbe_offset_cb *gbe_kernel_get_curbe_offset = GBE_EXPORT_SYMBOL gbe_kernel_get_curbe_size_cb *gbe_kernel_get_curbe_size = NULL; GBE_EXPORT_SYMBOL gbe_kernel_get_stack_size_cb *gbe_kernel_get_stack_size = NULL; GBE_EXPORT_SYMBOL gbe_kernel_get_scratch_size_cb *gbe_kernel_get_scratch_size = NULL; -GBE_EXPORT_SYMBOL gbe_kernel_set_const_buffer_size_cb *gbe_kernel_set_const_buffer_size = NULL; GBE_EXPORT_SYMBOL gbe_kernel_get_required_work_group_size_cb *gbe_kernel_get_required_work_group_size = NULL; GBE_EXPORT_SYMBOL gbe_kernel_use_slm_cb *gbe_kernel_use_slm = NULL; GBE_EXPORT_SYMBOL gbe_kernel_get_slm_size_cb *gbe_kernel_get_slm_size = NULL; @@ -1126,7 +1119,6 @@ namespace gbe
gbe_kernel_get_curbe_size = gbe::kernelGetCurbeSize;
gbe_kernel_get_stack_size = gbe::kernelGetStackSize;
gbe_kernel_get_scratch_size = gbe::kernelGetScratchSize;
- gbe_kernel_set_const_buffer_size = gbe::kernelSetConstBufSize;
gbe_kernel_get_required_work_group_size = gbe::kernelGetRequiredWorkGroupSize;
gbe_kernel_use_slm = gbe::kernelUseSLM;
gbe_kernel_get_slm_size = gbe::kernelGetSLMSize; diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h index 65378c4..6e7035a 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -245,10 +245,6 @@ extern gbe_kernel_get_scratch_size_cb *gbe_kernel_get_scratch_size; typedef int32_t (gbe_kernel_get_curbe_offset_cb)(gbe_kernel, enum gbe_curbe_type type, uint32_t sub_type); extern gbe_kernel_get_curbe_offset_cb *gbe_kernel_get_curbe_offset;
-/*! Set the constant pointer arg size and return the cb offset in curbe */ -typedef int32_t (gbe_kernel_set_const_buffer_size_cb)(gbe_kernel, uint32_t argID, size_t sz); -extern gbe_kernel_set_const_buffer_size_cb *gbe_kernel_set_const_buffer_size;
-
/*! Indicates if a work group size is required. Return the required width or 0
* if none
*/
diff --git a/backend/src/backend/program.hpp b/backend/src/backend/program.hpp index 4afdb15..bd633c6 100644
--- a/backend/src/backend/program.hpp
+++ b/backend/src/backend/program.hpp
@@ -111,18 +111,6 @@ namespace gbe {
INLINE bool getUseSLM(void) const { return this->useSLM; }
/*! get slm size for kernel local variable */
INLINE uint32_t getSLMSize(void) const { return this->slmSize; }
- /*! set constant buffer size and return the cb curbe offset */
- int32_t setConstBufSize(uint32_t argID, size_t sz) {
-#ifdef GBE_COMPILER_AVAILABLE
- if(argID >= argNum) return -1;
- if(args[argID].type != GBE_ARG_CONSTANT_PTR) return -1;
- if(args[argID].bufSize != sz) {
- args[argID].bufSize = sz;
- return ctx->allocConstBuf(argID);
- }
-#endif
- return -1;
- }
/*! Set sampler set. */
void setSamplerSet(ir::SamplerSet *from) {
samplerSet = from;
diff --git a/src/cl_gbe_loader.cpp b/src/cl_gbe_loader.cpp index 56e3445..dee7d43 100644
--- a/src/cl_gbe_loader.cpp
+++ b/src/cl_gbe_loader.cpp
@@ -26,7 +26,6 @@
gbe_program_new_from_source_cb *compiler_program_new_from_source = 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_kernel_set_const_buffer_size_cb *compiler_kernel_set_const_buffer_size = NULL; gbe_set_image_base_index_cb *compiler_set_image_base_index = NULL;
//function pointer from libgbeinterp.so @@ -256,11 +255,6 @@ struct GbeLoaderInitializer
if (compiler_program_new_from_llvm == NULL)
return;
- //gbe_kernel_set_const_buffer_size is not used by runttime
- compiler_kernel_set_const_buffer_size = *(gbe_kernel_set_const_buffer_size_cb **)dlsym(dlhCompiler, "gbe_kernel_set_const_buffer_size");
- if (compiler_kernel_set_const_buffer_size == 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;
diff --git a/src/cl_gbe_loader.h b/src/cl_gbe_loader.h index 93da91c..699834a 100644
--- a/src/cl_gbe_loader.h
+++ b/src/cl_gbe_loader.h
@@ -27,7 +27,6 @@ extern "C" {
extern gbe_program_new_from_source_cb *compiler_program_new_from_source;
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_program_new_from_binary_cb *interp_program_new_from_binary;
--
1.8.3.2
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list