From b8d1ea9962a7bb443e845f5f035b254172fc4ae7 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Wed, 21 Apr 2021 10:45:34 +0100 Subject: [PATCH] Fold constant global variable (#1217) gWimpyBufferSize is never modified and is actually not used to modify the number of tests -- gWimpyReductionFactor is used for that purpose by some tests, but not all. This patch removes this unnecessary global variable to simplify the codebase, and reduce differences between tests. Signed-off-by: Marco Antognini --- .../math_brute_force/binary_double.cpp | 7 ---- .../math_brute_force/binary_float.cpp | 7 ---- .../math_brute_force/binary_i_double.cpp | 7 ---- .../math_brute_force/binary_i_float.cpp | 7 ---- .../binary_operator_double.cpp | 7 ---- .../binary_operator_float.cpp | 7 ---- .../binary_two_results_i_double.cpp | 37 +++++++++---------- .../binary_two_results_i_float.cpp | 37 +++++++++---------- .../math_brute_force/i_unary_double.cpp | 30 +++++++-------- .../math_brute_force/i_unary_float.cpp | 27 +++++++------- .../math_brute_force/macro_binary_double.cpp | 7 ---- .../math_brute_force/macro_binary_float.cpp | 7 ---- .../math_brute_force/macro_unary_double.cpp | 7 ---- .../math_brute_force/macro_unary_float.cpp | 7 ---- .../math_brute_force/mad_double.cpp | 23 ++++++------ .../math_brute_force/mad_float.cpp | 23 ++++++------ test_conformance/math_brute_force/main.cpp | 1 - .../math_brute_force/ternary_double.cpp | 31 ++++++++-------- .../math_brute_force/ternary_float.cpp | 33 ++++++++--------- .../math_brute_force/unary_double.cpp | 6 --- .../math_brute_force/unary_float.cpp | 7 ---- .../unary_two_results_double.cpp | 36 +++++++++--------- .../unary_two_results_float.cpp | 37 +++++++++---------- .../unary_two_results_i_double.cpp | 36 +++++++++--------- .../unary_two_results_i_float.cpp | 35 +++++++++--------- .../math_brute_force/unary_u_double.cpp | 21 +++++------ .../math_brute_force/unary_u_float.cpp | 25 ++++++------- test_conformance/math_brute_force/utility.h | 1 - 28 files changed, 210 insertions(+), 306 deletions(-) diff --git a/test_conformance/math_brute_force/binary_double.cpp b/test_conformance/math_brute_force/binary_double.cpp index cc46ebd3..9ecad99a 100644 --- a/test_conformance/math_brute_force/binary_double.cpp +++ b/test_conformance/math_brute_force/binary_double.cpp @@ -300,13 +300,6 @@ int TestFunc_Double_Double_Double(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_float.cpp b/test_conformance/math_brute_force/binary_float.cpp index 6bea0c9a..4186f1c4 100644 --- a/test_conformance/math_brute_force/binary_float.cpp +++ b/test_conformance/math_brute_force/binary_float.cpp @@ -291,13 +291,6 @@ int TestFunc_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_i_double.cpp b/test_conformance/math_brute_force/binary_i_double.cpp index 7e19b243..6a4ecfc4 100644 --- a/test_conformance/math_brute_force/binary_i_double.cpp +++ b/test_conformance/math_brute_force/binary_i_double.cpp @@ -302,13 +302,6 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_i_float.cpp b/test_conformance/math_brute_force/binary_i_float.cpp index 08790c9d..1e7103c2 100644 --- a/test_conformance/math_brute_force/binary_i_float.cpp +++ b/test_conformance/math_brute_force/binary_i_float.cpp @@ -294,13 +294,6 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_operator_double.cpp b/test_conformance/math_brute_force/binary_operator_double.cpp index dc1edf96..740c9d7f 100644 --- a/test_conformance/math_brute_force/binary_operator_double.cpp +++ b/test_conformance/math_brute_force/binary_operator_double.cpp @@ -298,13 +298,6 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d, / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_operator_float.cpp b/test_conformance/math_brute_force/binary_operator_float.cpp index bc037654..921f7101 100644 --- a/test_conformance/math_brute_force/binary_operator_float.cpp +++ b/test_conformance/math_brute_force/binary_operator_float.cpp @@ -288,13 +288,6 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d, / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/binary_two_results_i_double.cpp b/test_conformance/math_brute_force/binary_two_results_i_double.cpp index f548486f..e6243754 100644 --- a/test_conformance/math_brute_force/binary_two_results_i_double.cpp +++ b/test_conformance/math_brute_force/binary_two_results_i_double.cpp @@ -178,8 +178,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) int ftz = f->ftz || gForceFTZ; double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(double), bufferSize); + uint64_t step = getTestStep(sizeof(double), BUFFER_SIZE); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -204,21 +203,21 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) // Init input array double *p = (double *)gIn; double *p2 = (double *)gIn2; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { p[j] = DoubleFromUInt32(genrand_int32(d)); p2[j] = DoubleFromUInt32(genrand_int32(d)); } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; @@ -228,20 +227,20 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -253,8 +252,8 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_double) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -304,7 +303,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) cri.r = (double *)gOut_Ref; cri.i = (int *)gOut_Ref2; cri.f_ffpI = f->dfunc.f_ffpI; - cri.lim = bufferSize / sizeof(double); + cri.lim = BUFFER_SIZE / sizeof(double); cri.count = (cri.lim + threadCount - 1) / threadCount; ThreadPool_Do(ReferenceD, threadCount, &cri); } @@ -312,7 +311,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) { double *r = (double *)gOut_Ref; int *r2 = (int *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) r[j] = (double)f->dfunc.f_ffpI(s[j], s2[j], r2 + j); } @@ -321,14 +320,14 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -340,7 +339,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) // Verify data uint64_t *t = (uint64_t *)gOut_Ref; int32_t *t2 = (int32_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -549,7 +548,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/binary_two_results_i_float.cpp b/test_conformance/math_brute_force/binary_two_results_i_float.cpp index 01c3ca7d..476ae570 100644 --- a/test_conformance/math_brute_force/binary_two_results_i_float.cpp +++ b/test_conformance/math_brute_force/binary_two_results_i_float.cpp @@ -177,8 +177,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) int64_t maxError2 = 0; float maxErrorVal = 0.0f; float maxErrorVal2 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); cl_uint threadCount = GetThreadCount(); @@ -205,21 +204,21 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) // Init input array cl_uint *p = (cl_uint *)gIn; cl_uint *p2 = (cl_uint *)gIn2; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { p[j] = genrand_int32(d); p2[j] = genrand_int32(d); } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; @@ -229,20 +228,20 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -254,8 +253,8 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_float) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -305,7 +304,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) cri.r = (float *)gOut_Ref; cri.i = (int *)gOut_Ref2; cri.f_ffpI = f->func.f_ffpI; - cri.lim = bufferSize / sizeof(float); + cri.lim = BUFFER_SIZE / sizeof(float); cri.count = (cri.lim + threadCount - 1) / threadCount; ThreadPool_Do(ReferenceF, threadCount, &cri); } @@ -313,7 +312,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) { float *r = (float *)gOut_Ref; int *r2 = (int *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = (float)f->func.f_ffpI(s[j], s2[j], r2 + j); } @@ -322,14 +321,14 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -341,7 +340,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; int32_t *t2 = (int32_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -534,7 +533,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/i_unary_double.cpp b/test_conformance/math_brute_force/i_unary_double.cpp index 040f8e65..451e43e8 100644 --- a/test_conformance/math_brute_force/i_unary_double.cpp +++ b/test_conformance/math_brute_force/i_unary_double.cpp @@ -125,9 +125,9 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) cl_program programs[VECTOR_SIZE_COUNT]; cl_kernel kernels[VECTOR_SIZE_COUNT]; int ftz = f->ftz || gForceFTZ; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(cl_double), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(cl_double)) + 1); + uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE); + int scale = + (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(cl_double)) + 1); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -154,17 +154,17 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) double *p = (double *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j * scale); } else { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j); } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -174,10 +174,10 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -188,9 +188,9 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) // Run the kernels for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { - size_t vectorSize = sizeof(cl_double) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t vectorSize = sizeValues[j] * sizeof(cl_double); + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -219,7 +219,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) // Calculate the correctly rounded reference result int *r = (int *)gOut_Ref; double *s = (double *)gIn; - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) r[j] = f->dfunc.i_f(s[j]); // Read the data back @@ -227,7 +227,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -238,7 +238,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -270,7 +270,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/i_unary_float.cpp b/test_conformance/math_brute_force/i_unary_float.cpp index 61ce9a23..8883d7a1 100644 --- a/test_conformance/math_brute_force/i_unary_float.cpp +++ b/test_conformance/math_brute_force/i_unary_float.cpp @@ -123,9 +123,8 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) cl_program programs[VECTOR_SIZE_COUNT]; cl_kernel kernels[VECTOR_SIZE_COUNT]; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(float)) + 1); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); + int scale = (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(float)) + 1); logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); @@ -152,17 +151,17 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) cl_uint *p = (cl_uint *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (cl_uint)i + j * scale; } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (uint32_t)i + j; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -172,10 +171,10 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -187,8 +186,8 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_float); - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -217,7 +216,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) // Calculate the correctly rounded reference result int *r = (int *)gOut_Ref; float *s = (float *)gIn; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = f->func.i_f(s[j]); // Read the data back @@ -225,7 +224,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -236,7 +235,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -268,7 +267,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/macro_binary_double.cpp b/test_conformance/math_brute_force/macro_binary_double.cpp index 4085bbd5..99c71b68 100644 --- a/test_conformance/math_brute_force/macro_binary_double.cpp +++ b/test_conformance/math_brute_force/macro_binary_double.cpp @@ -284,13 +284,6 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/macro_binary_float.cpp b/test_conformance/math_brute_force/macro_binary_float.cpp index 7c51895a..44050b7c 100644 --- a/test_conformance/math_brute_force/macro_binary_float.cpp +++ b/test_conformance/math_brute_force/macro_binary_float.cpp @@ -274,13 +274,6 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/macro_unary_double.cpp b/test_conformance/math_brute_force/macro_unary_double.cpp index d2501e22..49852a85 100644 --- a/test_conformance/math_brute_force/macro_unary_double.cpp +++ b/test_conformance/math_brute_force/macro_unary_double.cpp @@ -162,13 +162,6 @@ int TestMacro_Int_Double(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/macro_unary_float.cpp b/test_conformance/math_brute_force/macro_unary_float.cpp index 94a315d0..116f8d74 100644 --- a/test_conformance/math_brute_force/macro_unary_float.cpp +++ b/test_conformance/math_brute_force/macro_unary_float.cpp @@ -161,13 +161,6 @@ int TestMacro_Int_Float(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/mad_double.cpp b/test_conformance/math_brute_force/mad_double.cpp index a5f59183..aa245073 100644 --- a/test_conformance/math_brute_force/mad_double.cpp +++ b/test_conformance/math_brute_force/mad_double.cpp @@ -141,8 +141,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; double maxErrorVal3 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(double), bufferSize); + uint64_t step = getTestStep(sizeof(double), BUFFER_SIZE); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -162,7 +161,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) double *p = (double *)gIn; double *p2 = (double *)gIn2; double *p3 = (double *)gIn3; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { p[j] = DoubleFromUInt32(genrand_int32(d)); p2[j] = DoubleFromUInt32(genrand_int32(d)); @@ -170,21 +169,21 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0, - bufferSize, gIn3, 0, NULL, NULL))) + BUFFER_SIZE, gIn3, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer3 ***\n", error); return error; @@ -194,10 +193,10 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -209,8 +208,8 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_double) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -253,7 +252,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) double *s = (double *)gIn; double *s2 = (double *)gIn2; double *s3 = (double *)gIn3; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) r[j] = (double)f->dfunc.f_fff(s[j], s2[j], s3[j]); // Read the data back @@ -261,7 +260,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; diff --git a/test_conformance/math_brute_force/mad_float.cpp b/test_conformance/math_brute_force/mad_float.cpp index ff4e99d0..5d99eb0e 100644 --- a/test_conformance/math_brute_force/mad_float.cpp +++ b/test_conformance/math_brute_force/mad_float.cpp @@ -142,8 +142,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) float maxErrorVal = 0.0f; float maxErrorVal2 = 0.0f; float maxErrorVal3 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); // Init the kernels { @@ -161,7 +160,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) cl_uint *p = (cl_uint *)gIn; cl_uint *p2 = (cl_uint *)gIn2; cl_uint *p3 = (cl_uint *)gIn3; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { p[j] = genrand_int32(d); p2[j] = genrand_int32(d); @@ -169,21 +168,21 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0, - bufferSize, gIn3, 0, NULL, NULL))) + BUFFER_SIZE, gIn3, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer3 ***\n", error); return error; @@ -193,10 +192,10 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -208,8 +207,8 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_float) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -252,7 +251,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) float *s = (float *)gIn; float *s2 = (float *)gIn2; float *s3 = (float *)gIn3; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = (float)f->func.f_fff(s[j], s2[j], s3[j]); // Read the data back @@ -260,7 +259,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; diff --git a/test_conformance/math_brute_force/main.cpp b/test_conformance/math_brute_force/main.cpp index 1cfc3c43..7b06ca87 100644 --- a/test_conformance/math_brute_force/main.cpp +++ b/test_conformance/math_brute_force/main.cpp @@ -100,7 +100,6 @@ cl_mem gOutBuffer2[VECTOR_SIZE_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL }; static MTdata gMTdata; cl_device_fp_config gFloatCapabilities = 0; int gWimpyReductionFactor = 32; -int gWimpyBufferSize = BUFFER_SIZE; int gVerboseBruteForce = 0; static int ParseArgs(int argc, const char **argv); diff --git a/test_conformance/math_brute_force/ternary_double.cpp b/test_conformance/math_brute_force/ternary_double.cpp index 6e0327a2..02d06fe3 100644 --- a/test_conformance/math_brute_force/ternary_double.cpp +++ b/test_conformance/math_brute_force/ternary_double.cpp @@ -218,8 +218,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; double maxErrorVal3 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(double), bufferSize); + uint64_t step = getTestStep(sizeof(double), BUFFER_SIZE); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -246,7 +245,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, { // test edge cases uint32_t x, y, z; x = y = z = 0; - for (; j < bufferSize / sizeof(double); j++) + for (; j < BUFFER_SIZE / sizeof(double); j++) { p[j] = specialValues[x]; p2[j] = specialValues[y]; @@ -261,11 +260,11 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, } } } - if (j == bufferSize / sizeof(double)) + if (j == BUFFER_SIZE / sizeof(double)) vlog_error("Test Error: not all special cases tested!\n"); } - for (; j < bufferSize / sizeof(double); j++) + for (; j < BUFFER_SIZE / sizeof(double); j++) { p[j] = DoubleFromUInt32(genrand_int32(d)); p2[j] = DoubleFromUInt32(genrand_int32(d)); @@ -273,21 +272,21 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0, - bufferSize, gIn3, 0, NULL, NULL))) + BUFFER_SIZE, gIn3, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer3 ***\n", error); return error; @@ -297,10 +296,10 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -312,8 +311,8 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_double) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -356,7 +355,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, double *s = (double *)gIn; double *s2 = (double *)gIn2; double *s3 = (double *)gIn3; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) r[j] = (double)f->dfunc.f_fff(s[j], s2[j], s3[j]); // Read the data back @@ -364,7 +363,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -375,7 +374,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, // Verify data uint64_t *t = (uint64_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -707,7 +706,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/ternary_float.cpp b/test_conformance/math_brute_force/ternary_float.cpp index 9ef59887..5ad564aa 100644 --- a/test_conformance/math_brute_force/ternary_float.cpp +++ b/test_conformance/math_brute_force/ternary_float.cpp @@ -228,8 +228,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) float maxErrorVal = 0.0f; float maxErrorVal2 = 0.0f; float maxErrorVal3 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); cl_uchar overflow[BUFFER_SIZE / sizeof(float)]; @@ -265,7 +264,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) float *fp3 = (float *)gIn3; uint32_t x, y, z; x = y = z = 0; - for (; j < bufferSize / sizeof(float); j++) + for (; j < BUFFER_SIZE / sizeof(float); j++) { fp[j] = specialValues[x]; fp2[j] = specialValues[y]; @@ -281,11 +280,11 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) } } } - if (j == bufferSize / sizeof(float)) + if (j == BUFFER_SIZE / sizeof(float)) vlog_error("Test Error: not all special cases tested!\n"); } - for (; j < bufferSize / sizeof(float); j++) + for (; j < BUFFER_SIZE / sizeof(float); j++) { p[j] = genrand_int32(d); p2[j] = genrand_int32(d); @@ -293,21 +292,21 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer2, CL_FALSE, 0, - bufferSize, gIn2, 0, NULL, NULL))) + BUFFER_SIZE, gIn2, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2 ***\n", error); return error; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer3, CL_FALSE, 0, - bufferSize, gIn3, 0, NULL, NULL))) + BUFFER_SIZE, gIn3, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer3 ***\n", error); return error; @@ -317,10 +316,10 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -332,8 +331,8 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeof(cl_float) * sizeValues[j]; - size_t localCount = (bufferSize + vectorSize - 1) - / vectorSize; // bufferSize / vectorSize rounded up + size_t localCount = (BUFFER_SIZE + vectorSize - 1) + / vectorSize; // BUFFER_SIZE / vectorSize rounded up if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -378,7 +377,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) float *s3 = (float *)gIn3; if (skipNanInf) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { feclearexcept(FE_OVERFLOW); r[j] = @@ -389,7 +388,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = (float)f->func.f_fma(s[j], s2[j], s3[j], CORRECTLY_ROUNDED); } @@ -399,7 +398,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -410,7 +409,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -842,7 +841,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10u bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_double.cpp b/test_conformance/math_brute_force/unary_double.cpp index 3b2fe473..fe3edef7 100644 --- a/test_conformance/math_brute_force/unary_double.cpp +++ b/test_conformance/math_brute_force/unary_double.cpp @@ -170,12 +170,6 @@ int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode) test_info.subBufferSize = BUFFER_SIZE / (sizeof(cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_double)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_double) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) diff --git a/test_conformance/math_brute_force/unary_float.cpp b/test_conformance/math_brute_force/unary_float.cpp index 83d5e807..a0e45a2a 100644 --- a/test_conformance/math_brute_force/unary_float.cpp +++ b/test_conformance/math_brute_force/unary_float.cpp @@ -171,13 +171,6 @@ int TestFunc_Float_Float(const Func *f, MTdata d, bool relaxedMode) / (sizeof(cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount)); test_info.scale = getTestScale(sizeof(cl_float)); - if (gWimpyMode) - { - test_info.subBufferSize = gWimpyBufferSize - / (sizeof(cl_float) - * RoundUpToNextPowerOfTwo(test_info.threadCount)); - } - test_info.step = (cl_uint)test_info.subBufferSize * test_info.scale; if (test_info.step / test_info.subBufferSize != test_info.scale) { diff --git a/test_conformance/math_brute_force/unary_two_results_double.cpp b/test_conformance/math_brute_force/unary_two_results_double.cpp index 9402e24c..6f3a080b 100644 --- a/test_conformance/math_brute_force/unary_two_results_double.cpp +++ b/test_conformance/math_brute_force/unary_two_results_double.cpp @@ -136,9 +136,9 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) int ftz = f->ftz || gForceFTZ; double maxErrorVal0 = 0.0f; double maxErrorVal1 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(cl_double), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(cl_double)) + 1); + uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE); + int scale = + (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(cl_double)) + 1); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -160,16 +160,16 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) double *p = (double *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j * scale); } else { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j); } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -179,20 +179,20 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -204,7 +204,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_double); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -240,7 +240,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) double *r = (double *)gOut_Ref; double *r2 = (double *)gOut_Ref2; double *s = (double *)gIn; - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) { long double dd; r[j] = (double)f->dfunc.f_fpf(s[j], &dd); @@ -252,14 +252,14 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -271,7 +271,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) // Verify data uint64_t *t = (uint64_t *)gOut_Ref; uint64_t *t2 = (uint64_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -413,7 +413,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_two_results_float.cpp b/test_conformance/math_brute_force/unary_two_results_float.cpp index d3fbf20b..f3cf032d 100644 --- a/test_conformance/math_brute_force/unary_two_results_float.cpp +++ b/test_conformance/math_brute_force/unary_two_results_float.cpp @@ -136,9 +136,8 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); float maxErrorVal0 = 0.0f; float maxErrorVal1 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(float)) + 1); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); + int scale = (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(float)) + 1); cl_uchar overflow[BUFFER_SIZE / sizeof(float)]; int isFract = 0 == strcmp("fract", f->nameInCode); int skipNanInf = isFract && !gInfNanSupport; @@ -162,7 +161,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) uint32_t *p = (uint32_t *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { p[j] = (uint32_t)i + j * scale; if (relaxedMode && strcmp(f->name, "sincos") == 0) @@ -174,7 +173,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { p[j] = (uint32_t)i + j; if (relaxedMode && strcmp(f->name, "sincos") == 0) @@ -186,7 +185,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -196,20 +195,20 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -221,7 +220,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_float); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -273,7 +272,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) if (skipNanInf) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { double dd; feclearexcept(FE_OVERFLOW); @@ -290,7 +289,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { double dd; if (relaxedMode) @@ -309,14 +308,14 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -332,7 +331,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; uint32_t *t2 = (uint32_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -548,7 +547,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_two_results_i_double.cpp b/test_conformance/math_brute_force/unary_two_results_i_double.cpp index 66bf414e..df1a5aa8 100644 --- a/test_conformance/math_brute_force/unary_two_results_i_double.cpp +++ b/test_conformance/math_brute_force/unary_two_results_i_double.cpp @@ -144,9 +144,9 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; cl_ulong maxiError = f->double_ulps == INFINITY ? CL_ULONG_MAX : 0; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(cl_double), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(cl_double)) + 1); + uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE); + int scale = + (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(cl_double)) + 1); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -168,16 +168,16 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) double *p = (double *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j * scale); } else { - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) p[j] = DoubleFromUInt32((uint32_t)i + j); } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -187,20 +187,20 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -212,7 +212,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_double); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -248,7 +248,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) double *r = (double *)gOut_Ref; int *r2 = (int *)gOut_Ref2; double *s = (double *)gIn; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) r[j] = (double)f->dfunc.f_fpI(s[j], r2 + j); // Read the data back @@ -256,14 +256,14 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -275,7 +275,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) // Verify data uint64_t *t = (uint64_t *)gOut_Ref; int32_t *t2 = (int32_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -385,7 +385,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_two_results_i_float.cpp b/test_conformance/math_brute_force/unary_two_results_i_float.cpp index f6647b22..c95ee061 100644 --- a/test_conformance/math_brute_force/unary_two_results_i_float.cpp +++ b/test_conformance/math_brute_force/unary_two_results_i_float.cpp @@ -141,9 +141,8 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); float maxErrorVal = 0.0f; float maxErrorVal2 = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(float)) + 1); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); + int scale = (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(float)) + 1); cl_ulong maxiError; logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); @@ -172,16 +171,16 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) uint32_t *p = (uint32_t *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (uint32_t)i + j * scale; } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (uint32_t)i + j; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -191,20 +190,20 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); goto exit; } - memset_pattern4(gOut2[j], &pattern, bufferSize); - if ((error = - clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + memset_pattern4(gOut2[j], &pattern, BUFFER_SIZE); + if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer2[j], CL_FALSE, + 0, BUFFER_SIZE, gOut2[j], 0, NULL, + NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2b(%d) ***\n", error, j); @@ -216,7 +215,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_float); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -252,7 +251,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) float *r = (float *)gOut_Ref; int *r2 = (int *)gOut_Ref2; float *s = (float *)gIn; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = (float)f->func.f_fpI(s[j], r2 + j); // Read the data back @@ -260,14 +259,14 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; } if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer2[j], CL_TRUE, 0, - bufferSize, gOut2[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut2[j], 0, NULL, NULL))) { vlog_error("ReadArray2 failed %d\n", error); goto exit; @@ -279,7 +278,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; int32_t *t2 = (int32_t *)gOut_Ref2; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -384,7 +383,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_u_double.cpp b/test_conformance/math_brute_force/unary_u_double.cpp index c7034577..5f252614 100644 --- a/test_conformance/math_brute_force/unary_u_double.cpp +++ b/test_conformance/math_brute_force/unary_u_double.cpp @@ -134,8 +134,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) float maxError = 0.0f; int ftz = f->ftz || gForceFTZ; double maxErrorVal = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(cl_double), bufferSize); + uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE); logFunctionInfo(f->name, sizeof(cl_double), relaxedMode); @@ -155,10 +154,10 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) { // Init input array cl_ulong *p = (cl_ulong *)gIn; - for (j = 0; j < bufferSize / sizeof(cl_ulong); j++) p[j] = random64(d); + for (j = 0; j < BUFFER_SIZE / sizeof(cl_ulong); j++) p[j] = random64(d); if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -168,10 +167,10 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -183,7 +182,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_double); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -212,7 +211,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) // Calculate the correctly rounded reference result double *r = (double *)gOut_Ref; cl_ulong *s = (cl_ulong *)gIn; - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) r[j] = (double)f->dfunc.f_u(s[j]); // Read the data back @@ -220,7 +219,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -231,7 +230,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) // Verify data uint64_t *t = (uint64_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(cl_double); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(cl_double); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -283,7 +282,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/unary_u_float.cpp b/test_conformance/math_brute_force/unary_u_float.cpp index 86389e4a..18534dc5 100644 --- a/test_conformance/math_brute_force/unary_u_float.cpp +++ b/test_conformance/math_brute_force/unary_u_float.cpp @@ -126,9 +126,8 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) float maxError = 0.0f; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); float maxErrorVal = 0.0f; - size_t bufferSize = (gWimpyMode) ? gWimpyBufferSize : BUFFER_SIZE; - uint64_t step = getTestStep(sizeof(float), bufferSize); - int scale = (int)((1ULL << 32) / (16 * bufferSize / sizeof(double)) + 1); + uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); + int scale = (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(double)) + 1); int isRangeLimited = 0; float half_sin_cos_tan_limit = 0; @@ -172,16 +171,16 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) uint32_t *p = (uint32_t *)gIn; if (gWimpyMode) { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (uint32_t)i + j * scale; } else { - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) p[j] = (uint32_t)i + j; } if ((error = clEnqueueWriteBuffer(gQueue, gInBuffer, CL_FALSE, 0, - bufferSize, gIn, 0, NULL, NULL))) + BUFFER_SIZE, gIn, 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer ***\n", error); return error; @@ -191,10 +190,10 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { uint32_t pattern = 0xffffdead; - memset_pattern4(gOut[j], &pattern, bufferSize); + memset_pattern4(gOut[j], &pattern, BUFFER_SIZE); if ((error = clEnqueueWriteBuffer(gQueue, gOutBuffer[j], CL_FALSE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("\n*** Error %d in clEnqueueWriteBuffer2(%d) ***\n", error, j); @@ -206,7 +205,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { size_t vectorSize = sizeValues[j] * sizeof(cl_float); - size_t localCount = (bufferSize + vectorSize - 1) / vectorSize; + size_t localCount = (BUFFER_SIZE + vectorSize - 1) / vectorSize; if ((error = clSetKernelArg(kernels[j], 0, sizeof(gOutBuffer[j]), &gOutBuffer[j]))) { @@ -235,7 +234,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) // Calculate the correctly rounded reference result float *r = (float *)gOut_Ref; cl_uint *s = (cl_uint *)gIn; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) r[j] = (float)f->func.f_u(s[j]); // Read the data back @@ -243,7 +242,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) { if ((error = clEnqueueReadBuffer(gQueue, gOutBuffer[j], CL_TRUE, 0, - bufferSize, gOut[j], 0, NULL, NULL))) + BUFFER_SIZE, gOut[j], 0, NULL, NULL))) { vlog_error("ReadArray failed %d\n", error); goto exit; @@ -255,7 +254,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) // Verify data uint32_t *t = (uint32_t *)gOut_Ref; - for (j = 0; j < bufferSize / sizeof(float); j++) + for (j = 0; j < BUFFER_SIZE / sizeof(float); j++) { for (k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) { @@ -316,7 +315,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) if (gVerboseBruteForce) { vlog("base:%14u step:%10zu bufferSize:%10zd \n", i, step, - bufferSize); + BUFFER_SIZE); } else { diff --git a/test_conformance/math_brute_force/utility.h b/test_conformance/math_brute_force/utility.h index 0e11457c..ac4db9c8 100644 --- a/test_conformance/math_brute_force/utility.h +++ b/test_conformance/math_brute_force/utility.h @@ -34,7 +34,6 @@ struct Func; -extern int gWimpyBufferSize; extern int gWimpyReductionFactor; #define VECTOR_SIZE_COUNT 6