From e7207fdd17f9795c66a8b855af827fbae1bbca54 Mon Sep 17 00:00:00 2001 From: Brice Videau Date: Tue, 19 Nov 2013 18:27:01 -0700 Subject: [PATCH] Moved some declarations to the header as they are needed in the generated part now. --- icd_generator.rb | 14 +++++++++++++- ocl_icd_loader.c | 18 +----------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/icd_generator.rb b/icd_generator.rb index 22644e0..e5f7076 100644 --- a/icd_generator.rb +++ b/icd_generator.rb @@ -343,8 +343,20 @@ struct func_desc { const char* name; void(*const addr)(void); }; - +typedef __typeof__(clGetExtensionFunctionAddress) *clGetExtensionFunctionAddress_fn; extern const struct func_desc function_description[]; +struct vendor_icd { + cl_uint num_platforms; + cl_uint first_platform; + void * dl_handle; + clGetExtensionFunctionAddress_fn ext_fn_ptr; +}; +struct platform_icd { + char * extension_suffix; + char * version; + struct vendor_icd *vicd; + cl_platform_id pid; +}; EOF ocl_icd_header += "extern struct _cl_icd_dispatch master_dispatch;\n" diff --git a/ocl_icd_loader.c b/ocl_icd_loader.c index 0972dc9..763b362 100644 --- a/ocl_icd_loader.c +++ b/ocl_icd_loader.c @@ -53,33 +53,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. int debug_ocl_icd_mask=0; -typedef __typeof__(clGetExtensionFunctionAddress) *clGetExtensionFunctionAddress_fn; typedef __typeof__(clGetPlatformInfo) *clGetPlatformInfo_fn; - -struct vendor_icd { - cl_uint num_platforms; - cl_uint first_platform; - void * dl_handle; - clGetExtensionFunctionAddress_fn ext_fn_ptr; -}; - inline void dump_vendor_icd(const char* info, const struct vendor_icd *v) { debug(D_DUMP, "%s %p={ num=%i, first=%i, handle=%p, f=%p}\n", info, v, v->num_platforms, v->first_platform, v->dl_handle, v->ext_fn_ptr); } -struct platform_icd { - char * extension_suffix; - char * version; - struct vendor_icd *vicd; - cl_platform_id pid; -}; - struct vendor_icd *_icds=NULL; struct platform_icd *_picds=NULL; static cl_uint _num_icds = 0; -static cl_uint _num_picds = 0; +cl_uint _num_picds = 0; #ifdef DEBUG_OCL_ICD # define _clS(x) [-x] = #x -- 2.32.0.93.g670b81a890