Conditionally test BGRA in Basic readimage3d (#623) (#624)

* imageHelpers: Created generic function that returns a vector of required image formats.

An upcoming commit requires access to the vector of required image formats, separatley from check_minimum_supported.

* imageHelpers: Added a new function is_image_format_required.

This function can be used to determine for any given cl_image_format, whether the implementaion is required to support it.

Conditionally test BGRA in Basic readimage3d (#623)

This change adds checks to see if testing against an embedded implementation and if so, queries whether BGRA is supported or not.

* Refactor based on PR review.

* Update passed message code.

* Changed scope of struct to be within test_readimage3d.
This commit is contained in:
Kévin Petit
2020-03-05 18:47:51 +00:00
committed by GitHub
parent e62cd4a2b9
commit 4c5a8fff6d
4 changed files with 145 additions and 127 deletions

View File

@@ -23,6 +23,7 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <vector>
#if !defined(_WIN32)
#include <unistd.h>
@@ -71,11 +72,14 @@ 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,
cl_mem_object_type image_type,
cl_device_id device);
extern bool is_image_format_required(cl_image_format format,
cl_mem_flags flags,
cl_mem_object_type image_type,
cl_device_id device);
extern void build_required_image_formats(cl_mem_flags flags,
cl_mem_object_type image_type,
cl_device_id device,
std::vector<cl_image_format>& formatsToSupport);
extern size_t get_format_type_size( const cl_image_format *format );
extern size_t get_channel_data_type_size( cl_channel_type channelType );