Improve consistency of clEnqueueWriteBuffer operations (#1195)

Reduce differences between tests by ensuring all these operations are
non-blocking.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
Marco Antognini
2021-03-24 16:29:25 +00:00
committed by GitHub
parent 8488d4b2de
commit 5281b4c916
2 changed files with 7 additions and 7 deletions

View File

@@ -210,14 +210,14 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
p2[j] = DoubleFromUInt32(genrand_int32(d)); p2[j] = DoubleFromUInt32(genrand_int32(d));
} }
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_TRUE, 0, if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0,
bufferSize, gIn, 0, NULL, NULL))) bufferSize, gIn, 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error);
return error; return error;
} }
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_TRUE, 0, if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0,
bufferSize, gIn2, 0, NULL, NULL))) bufferSize, gIn2, 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error);
@@ -230,7 +230,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
uint32_t pattern = 0xffffdead; uint32_t pattern = 0xffffdead;
memset_pattern4(gOut[j], &pattern, bufferSize); memset_pattern4(gOut[j], &pattern, bufferSize);
if ((error = if ((error =
clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0,
bufferSize, gOut[j], 0, NULL, NULL))) bufferSize, gOut[j], 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n",
@@ -240,7 +240,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
memset_pattern4(gOut2[j], &pattern, bufferSize); memset_pattern4(gOut2[j], &pattern, bufferSize);
if ((error = if ((error =
clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0,
bufferSize, gOut2[j], 0, NULL, NULL))) bufferSize, gOut2[j], 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n",
@@ -573,13 +573,13 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
double *p = (double *)gIn; double *p = (double *)gIn;
for (j = 0; j < bufferSize / sizeof(cl_double); j++) for (j = 0; j < bufferSize / sizeof(cl_double); j++)
p[j] = DoubleFromUInt32(genrand_int32(d)); p[j] = DoubleFromUInt32(genrand_int32(d));
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_TRUE, 0, if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0,
bufferSize, gIn, 0, NULL, NULL))) bufferSize, gIn, 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error);
return error; return error;
} }
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_TRUE, 0, if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0,
bufferSize, gIn2, 0, NULL, NULL))) bufferSize, gIn2, 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error);

View File

@@ -218,7 +218,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode)
return error; return error;
} }
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_TRUE, 0, if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0,
bufferSize, gIn2, 0, NULL, NULL))) bufferSize, gIn2, 0, NULL, NULL)))
{ {
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error);