Fix clCopyImage 1D buffer images tests with use_pitches flag #2167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes the following issues when running
clCopyImage
test withuse_pitches
flag for 1D buffer images.CL_DEVICE_NUMERIC_VERSION
instead ofCL_DEVICE_VERSION
. Previously, usingchar
may not be enough to store the return value. The change queries the version similar toclFillImage
test binary.host_ptr
toclCreateBuffer
when creating the buffer for the 1D image.host_ptr
may not benullptr
if use_pitches flag is used. Also,buffer_flags
will containCL_MEM_USE_HOST_PTR
which requires a host pointer to be passed.host_ptr
when callingclCreateImage
, it will not be used with 1D image buffer. This is made to align with the spec, in which ifmem_flags
hasCL_MEM_USE_HOST_PTR
a host pointer must be present, but if the memory flag is not present, host pointer must benullptr
.free
andalign_free
based on the allocation function that was used.