Update table of required image formats (#427) (#629)

* Update table of required image formats (#427)

This commit updates the table of required image formats. The table is built depending on the profile of the device, the requested image type, and the avaiablitiy of relevent extensions.

* Fixed incorrect argument to memcpy.

* Made image format arrays static.

* Utilised ARRAY_SIZE where appropriate.

* Re-named required image format bools to be more explicit.

* Made sRGBA, CL_UNORM_INT8 a required full format profile.

Misinterpretation of the spec had made this optional.

* check_minimum_supported: switched to using vectors.

* Added CL_sRGB CL_UNORM_INT8 to full profile required formats.

This matches the same channel data type requirement as CL_sRGBA.

* Overload <= and >= for the Version class.

* Correct the condition under which sRGB images are required.

* Correct the required image formats are based on OpenCL version.

The spec says that for different OpenCL versions, different sets of image formats are required.

* Print out the correct OpenCL version when required image format is not found.

* Improved the way in which image formats are added based on profile and version.

* Potential build fix regarding isnan namespace issues.

* Image Helpers: Remove duplicate copies when building required image format vectors.

Also re-ordered a branch to make it clearer.
This commit is contained in:
Jeremy Kemp
2020-03-03 21:39:32 +00:00
committed by GitHub
parent b1059a2c56
commit 4c59bfa32f
4 changed files with 163 additions and 44 deletions

View File

@@ -71,7 +71,11 @@ extern void print_read_header( cl_image_format *format, image_sampler_data *samp
extern void print_write_header( cl_image_format *format, bool err);
extern void print_header( cl_image_format *format, bool err );
extern bool find_format( cl_image_format *formatList, unsigned int numFormats, cl_image_format *formatToFind );
extern bool check_minimum_supported( cl_image_format *formatList, unsigned int numFormats, cl_mem_flags flags );
extern bool check_minimum_supported(cl_image_format *formatList,
unsigned int numFormats,
cl_mem_flags flags,
cl_mem_object_type image_type,
cl_device_id device);
extern size_t get_format_type_size( const cl_image_format *format );
extern size_t get_channel_data_type_size( cl_channel_type channelType );