mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-23 15:39:03 +00:00
Reduce difference between files (#1155)
Moves `if (!gSkipCorrectnessTesting)` in binary_i.cpp to follow structure of binary.cpp, unary.cpp, macro_unary.cpp and macro_binary.cpp. Other non-semantic changes include adding/removing new lines and updating comments. Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
@@ -634,6 +634,7 @@ static int TestFunc_Float_Float_Float_common(const Func *f, MTdata d,
|
|||||||
vlog("\n");
|
vlog("\n");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
// Release
|
||||||
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||||
{
|
{
|
||||||
clReleaseProgram(test_info.programs[i]);
|
clReleaseProgram(test_info.programs[i]);
|
||||||
|
|||||||
@@ -567,7 +567,6 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d,
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
@@ -633,6 +632,7 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d,
|
|||||||
vlog("\n");
|
vlog("\n");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
// Release
|
||||||
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||||
{
|
{
|
||||||
clReleaseProgram(test_info.programs[i]);
|
clReleaseProgram(test_info.programs[i]);
|
||||||
@@ -1147,7 +1147,6 @@ exit:
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A table of more difficult cases to get right
|
// A table of more difficult cases to get right
|
||||||
static const double specialValuesDouble[] = {
|
static const double specialValuesDouble[] = {
|
||||||
-NAN,
|
-NAN,
|
||||||
@@ -1437,6 +1436,7 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d,
|
|||||||
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_FALSE, 0,
|
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0,
|
||||||
BUFFER_SIZE, gIn2, 0, NULL, NULL)))
|
BUFFER_SIZE, gIn2, 0, NULL, NULL)))
|
||||||
{
|
{
|
||||||
@@ -1444,7 +1444,6 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d,
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -513,24 +513,23 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
error = ThreadPool_Do(TestFloat, test_info.jobCount, &test_info);
|
|
||||||
|
|
||||||
|
|
||||||
// Accumulate the arithmetic errors
|
|
||||||
for (i = 0; i < test_info.threadCount; i++)
|
|
||||||
{
|
|
||||||
if (test_info.tinfo[i].maxError > maxError)
|
|
||||||
{
|
|
||||||
maxError = test_info.tinfo[i].maxError;
|
|
||||||
maxErrorVal = test_info.tinfo[i].maxErrorValue;
|
|
||||||
maxErrorVal2 = test_info.tinfo[i].maxErrorValue2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (error) goto exit;
|
|
||||||
|
|
||||||
if (!gSkipCorrectnessTesting)
|
if (!gSkipCorrectnessTesting)
|
||||||
{
|
{
|
||||||
|
error = ThreadPool_Do(TestFloat, test_info.jobCount, &test_info);
|
||||||
|
|
||||||
|
// Accumulate the arithmetic errors
|
||||||
|
for (i = 0; i < test_info.threadCount; i++)
|
||||||
|
{
|
||||||
|
if (test_info.tinfo[i].maxError > maxError)
|
||||||
|
{
|
||||||
|
maxError = test_info.tinfo[i].maxError;
|
||||||
|
maxErrorVal = test_info.tinfo[i].maxErrorValue;
|
||||||
|
maxErrorVal2 = test_info.tinfo[i].maxErrorValue2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error) goto exit;
|
||||||
|
|
||||||
if (gWimpyMode)
|
if (gWimpyMode)
|
||||||
vlog("Wimp pass");
|
vlog("Wimp pass");
|
||||||
else
|
else
|
||||||
@@ -562,7 +561,6 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
@@ -628,6 +626,7 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
vlog("\n");
|
vlog("\n");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
// Release
|
||||||
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||||
{
|
{
|
||||||
clReleaseProgram(test_info.programs[i]);
|
clReleaseProgram(test_info.programs[i]);
|
||||||
@@ -1205,24 +1204,22 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
if (!gSkipCorrectnessTesting)
|
if (!gSkipCorrectnessTesting)
|
||||||
|
{
|
||||||
error = ThreadPool_Do(TestDouble, test_info.jobCount, &test_info);
|
error = ThreadPool_Do(TestDouble, test_info.jobCount, &test_info);
|
||||||
|
|
||||||
|
// Accumulate the arithmetic errors
|
||||||
// Accumulate the arithmetic errors
|
for (i = 0; i < test_info.threadCount; i++)
|
||||||
for (i = 0; i < test_info.threadCount; i++)
|
|
||||||
{
|
|
||||||
if (test_info.tinfo[i].maxError > maxError)
|
|
||||||
{
|
{
|
||||||
maxError = test_info.tinfo[i].maxError;
|
if (test_info.tinfo[i].maxError > maxError)
|
||||||
maxErrorVal = test_info.tinfo[i].maxErrorValue;
|
{
|
||||||
maxErrorVal2 = test_info.tinfo[i].maxErrorValue2;
|
maxError = test_info.tinfo[i].maxError;
|
||||||
|
maxErrorVal = test_info.tinfo[i].maxErrorValue;
|
||||||
|
maxErrorVal2 = test_info.tinfo[i].maxErrorValue2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (error) goto exit;
|
if (error) goto exit;
|
||||||
|
|
||||||
if (!gSkipCorrectnessTesting)
|
|
||||||
{
|
|
||||||
if (gWimpyMode)
|
if (gWimpyMode)
|
||||||
vlog("Wimp pass");
|
vlog("Wimp pass");
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -526,7 +526,6 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
@@ -590,6 +589,7 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
vlog("\n");
|
vlog("\n");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
// Release
|
||||||
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||||
{
|
{
|
||||||
clReleaseProgram(test_info.programs[i]);
|
clReleaseProgram(test_info.programs[i]);
|
||||||
@@ -934,7 +934,6 @@ exit:
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// A table of more difficult cases to get right
|
// A table of more difficult cases to get right
|
||||||
static const double specialValuesDouble[] = {
|
static const double specialValuesDouble[] = {
|
||||||
-NAN,
|
-NAN,
|
||||||
@@ -1207,6 +1206,7 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
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_FALSE, 0,
|
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0,
|
||||||
BUFFER_SIZE, gIn2, 0, NULL, NULL)))
|
BUFFER_SIZE, gIn2, 0, NULL, NULL)))
|
||||||
{
|
{
|
||||||
@@ -1214,7 +1214,6 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -441,6 +441,7 @@ int TestMacro_Int_Float(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
vlog("\n");
|
vlog("\n");
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
// Release
|
||||||
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
for (i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||||
{
|
{
|
||||||
clReleaseProgram(test_info.programs[i]);
|
clReleaseProgram(test_info.programs[i]);
|
||||||
@@ -507,7 +508,7 @@ static cl_int TestFloat(cl_uint job_id, cl_uint thread_id, void *data)
|
|||||||
// Get that moving
|
// Get that moving
|
||||||
if ((error = clFlush(tinfo->tQueue))) vlog("clFlush failed\n");
|
if ((error = clFlush(tinfo->tQueue))) vlog("clFlush failed\n");
|
||||||
|
|
||||||
// Write the new values to the input array
|
// Init input array
|
||||||
cl_uint *p = (cl_uint *)gIn + thread_id * buffer_elements;
|
cl_uint *p = (cl_uint *)gIn + thread_id * buffer_elements;
|
||||||
for (j = 0; j < buffer_elements; j++) p[j] = base + j * scale;
|
for (j = 0; j < buffer_elements; j++) p[j] = base + j * scale;
|
||||||
|
|
||||||
|
|||||||
@@ -676,18 +676,21 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
p2[j] = DoubleFromUInt32(genrand_int32(d));
|
p2[j] = DoubleFromUInt32(genrand_int32(d));
|
||||||
p3[j] = DoubleFromUInt32(genrand_int32(d));
|
p3[j] = DoubleFromUInt32(genrand_int32(d));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 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_FALSE, 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);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0,
|
if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0,
|
||||||
bufferSize, gIn3, 0, NULL, NULL)))
|
bufferSize, gIn3, 0, NULL, NULL)))
|
||||||
{
|
{
|
||||||
@@ -695,7 +698,6 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Run the kernels
|
// Run the kernels
|
||||||
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -629,7 +629,7 @@ static cl_int TestFloat(cl_uint job_id, cl_uint thread_id, void *data)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the kernel
|
// run the kernel
|
||||||
size_t vectorCount =
|
size_t vectorCount =
|
||||||
(buffer_elements + sizeValues[j] - 1) / sizeValues[j];
|
(buffer_elements + sizeValues[j] - 1) / sizeValues[j];
|
||||||
cl_kernel kernel = job->k[j][thread_id]; // each worker thread has its
|
cl_kernel kernel = job->k[j][thread_id]; // each worker thread has its
|
||||||
|
|||||||
Reference in New Issue
Block a user