mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-25 08:19:02 +00:00
Fix test_buffer - undefined behavior in case of CL_MEM_USE_HOST_PTR (#1210)
This commit is contained in:
committed by
GitHub
parent
71e2681414
commit
db939bbb20
@@ -702,10 +702,6 @@ int test_buffer_fill( cl_device_id deviceID, cl_context context, cl_command_queu
|
|||||||
|
|
||||||
int test_buffer_fill_struct( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
int test_buffer_fill_struct( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||||
{
|
{
|
||||||
clMemWrapper buffers[2];
|
|
||||||
void *outptr;
|
|
||||||
TestStruct *inptr;
|
|
||||||
TestStruct *hostptr;
|
|
||||||
TestStruct pattern;
|
TestStruct pattern;
|
||||||
clProgramWrapper program;
|
clProgramWrapper program;
|
||||||
clKernelWrapper kernel;
|
clKernelWrapper kernel;
|
||||||
@@ -741,6 +737,10 @@ int test_buffer_fill_struct( cl_device_id deviceID, cl_context context, cl_comma
|
|||||||
for (n = 0; n < 8; n++)
|
for (n = 0; n < 8; n++)
|
||||||
{
|
{
|
||||||
clEventWrapper event[2];
|
clEventWrapper event[2];
|
||||||
|
clMemWrapper buffers[2];
|
||||||
|
void *outptr;
|
||||||
|
TestStruct *inptr;
|
||||||
|
TestStruct *hostptr;
|
||||||
|
|
||||||
offset_elements =
|
offset_elements =
|
||||||
(size_t)get_random_float(0.f, (float)(num_elements - 8), d);
|
(size_t)get_random_float(0.f, (float)(num_elements - 8), d);
|
||||||
|
|||||||
Reference in New Issue
Block a user