Le 10/09/2012 16:46, [email protected] a écrit :
> message:
> Allow for ICD build even if ocl-icd is missing.
> === modified file 'lib/CL/pocl_icd.h'
> --- lib/CL/pocl_icd.h 2012-08-31 01:38:36 +0000
> +++ lib/CL/pocl_icd.h 2012-09-10 14:47:57 +0000
[...]
> -// Get the structure struct _cl_icd_dispatch from the OCL-ICD project
> -// (that provides a free OCL ICD Loader)
> -#include <ocl_icd.h>
> +struct _cl_icd_dispatch {
> + void *funcptr[73];
> +};
[...]
This is very fragile. ICD relies on a precise order of the function
pointers. Using the structure provided by ocl-icd, you are reasonably
sure that you put the good functions at the good place (the compiler
checks the type of function pointers)
Note that only development files of ocl-icd are required for this.
The ICD loader itself is not required to build the ICD. Any other one
can be used (one is needed because one is required at link time).
If you insist to allow building ICD without development files
of ocl-icd, please make you modifications conditional. Something
like (not tested):
#ifdef HAVE_OCL_ICD_DEV
// Get the structure struct _cl_icd_dispatch from the OCL-ICD project
// (that provides a free OCL ICD Loader)
# include <ocl_icd.h>
#else
// use a simple structure. No compiler type checking is done is this case.
struct _cl_icd_dispatch {
void *funcptr[73];
};
#endif
Of course, you will need to AC_DEFINE HAVE_OCL_ICD_DEV accordingly in
the configure.ac, ie when OCL_ICD_available=yes
Regards,
Vincent
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel