mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
This change fixes the following issues when running `clCopyImage` test with `use_pitches` flag for 1D buffer images. 1. Query device CL version using `get_device_cl_version` rather than using `CL_DEVICE_VERSION`. Previously, using `char` may not be enough to store the return value. 2. Pass `host_ptr` to `clCreateBuffer` when creating the buffer for the 1D image. `host_ptr` may not be `nullptr` if use_pitches flag is used. Also, `buffer_flags` will contain `CL_MEM_USE_HOST_PTR` which requires a host pointer to be passed. 3. Conditionally use the `host_ptr` when calling `clCreateImage`, it will not be used with 1D image buffer. This is made to align with the spec, in which if `mem_flags` has `CL_MEM_USE_HOST_PTR` a host pointer must be present, but if the memory flag is not present, host pointer must be `nullptr`. 4. Use the correct free function `free` and `align_free` based on the allocation function that was used. Signed-off-by: Michael Rizkalla <michael.rizkalla@arm.com>