mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Enqueue fill buffer (#1561)
* grab latest from upstream OpenCL * Use clEnqueueFillBuffer rather than memset4 in all test files * Cleanup leftover code from memset_pattern4 * Remove unnecessary map, unmap, writeBuffer from math_brute_force tests * Remove extraneous build system change * Appease clang-format * Add option to perform buffer fills on the host Co-authored-by: Taeten Prettyman <taeten.j@gmail.com> Co-authored-by: taetenp <taet@holochip.com> Co-authored-by: Chip Davis <chip@holochip.com>
This commit is contained in:
@@ -114,18 +114,33 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
return error;
|
||||
}
|
||||
|
||||
// write garbage into output arrays
|
||||
// Write garbage into output arrays
|
||||
for (auto j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||
{
|
||||
uint32_t pattern = 0xffffdead;
|
||||
memset_pattern4(gOut[j], &pattern, BUFFER_SIZE);
|
||||
if ((error =
|
||||
clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0,
|
||||
BUFFER_SIZE, gOut[j], 0, NULL, NULL)))
|
||||
if (gHostFill)
|
||||
{
|
||||
vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n",
|
||||
error, j);
|
||||
goto exit;
|
||||
memset_pattern4(gOut[j], &pattern, BUFFER_SIZE);
|
||||
if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j],
|
||||
CL_FALSE, 0, BUFFER_SIZE,
|
||||
gOut[j], 0, NULL, NULL)))
|
||||
{
|
||||
vlog_error(
|
||||
"\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n",
|
||||
error, j);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((error = clEnqueueFillBuffer(gQueue, gOutBuffer[j],
|
||||
&pattern, sizeof(pattern), 0,
|
||||
BUFFER_SIZE, 0, NULL, NULL)))
|
||||
{
|
||||
vlog_error("Error: clEnqueueFillBuffer failed! err: %d\n",
|
||||
error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user