Restored the embedded reduction factor to bruteforce.

This change was present on the GitLab branch but missed out during the transition to GitHub.

This change is intentionally as close as possible to the patch on GitLab.

Fixes #1045
This commit is contained in:
Jeremy Kemp
2020-11-09 18:47:13 +00:00
parent 657456f7df
commit bb6e8eabcc
14 changed files with 119 additions and 0 deletions

View File

@@ -31,6 +31,7 @@
#include "harness/conversions.h"
#define BUFFER_SIZE (1024*1024*2)
#define EMBEDDED_REDUCTION_FACTOR (64)
#if defined( __GNUC__ )
#define UNUSED __attribute__ ((unused))

View File

@@ -283,6 +283,11 @@ int TestFunc_Float_Float_Float_common(const Func *f, MTdata d, int isNextafter,
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{
@@ -1021,6 +1026,11 @@ int TestFunc_Double_Double_Double_common(const Func *f, MTdata d,
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{

View File

@@ -274,6 +274,10 @@ int TestFunc_Float_Float_Float_Operator(const Func *f, MTdata d,
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
@@ -969,6 +973,10 @@ int TestFunc_Double_Double_Double_Operator(const Func *f, MTdata d,
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)

View File

@@ -272,6 +272,11 @@ int TestFunc_Float_Float_Int(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{
@@ -786,6 +791,11 @@ int TestFunc_Double_Double_Int(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{

View File

@@ -297,6 +297,10 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode)
if(gWimpyMode ){
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
if( gIsEmbedded )
float_ulps = f->float_embedded_ulps;
@@ -722,6 +726,10 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
if(gWimpyMode ){
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
#if defined PARALLEL_REFERENCE
cl_uint threadCount = GetThreadCount();

View File

@@ -199,6 +199,10 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(cl_float)) * EMBEDDED_REDUCTION_FACTOR;
}
// This test is not using ThreadPool so we need to disable FTZ here
// for reference computations
@@ -420,6 +424,11 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(cl_double)) * EMBEDDED_REDUCTION_FACTOR;
}
// This test is not using ThreadPool so we need to disable FTZ here
// for reference computations
FPU_mode_type oldMode;

View File

@@ -259,6 +259,11 @@ int TestMacro_Int_Float_Float(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{
@@ -771,6 +776,10 @@ int TestMacro_Int_Double_Double(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)

View File

@@ -230,6 +230,11 @@ int TestMacro_Int_Float(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{
@@ -629,6 +634,10 @@ int TestMacro_Int_Double(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)

View File

@@ -213,6 +213,11 @@ int TestFunc_mad(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
// Init the kernels
BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs,
f->nameInCode, relaxedMode };
@@ -680,6 +685,11 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
// Init the kernels
BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs,
f->nameInCode, relaxedMode };

View File

@@ -238,6 +238,10 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
if( gIsEmbedded )
float_ulps = f->float_embedded_ulps;
@@ -879,6 +883,10 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d,
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
Force64BitFPUPrecision();

View File

@@ -246,6 +246,11 @@ int TestFunc_Float_Float(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_float) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_float) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{
@@ -1033,6 +1038,11 @@ int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode)
test_info.subBufferSize = gWimpyBufferSize / (sizeof( cl_double) * RoundUpToNextPowerOfTwo(test_info.threadCount));
test_info.scale = (cl_uint) sizeof(cl_double) * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
test_info.scale *= EMBEDDED_REDUCTION_FACTOR;
}
test_info.step = (cl_uint) test_info.subBufferSize * test_info.scale;
if (test_info.step / test_info.subBufferSize != test_info.scale)
{

View File

@@ -215,6 +215,10 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
// Init the kernels
BuildKernelInfo build_info = { gMinVectorSizeIndex, kernels, programs,
@@ -674,6 +678,10 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
Force64BitFPUPrecision();

View File

@@ -218,6 +218,11 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
if( gIsEmbedded )
float_ulps = f->float_embedded_ulps;
else
@@ -521,6 +526,10 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
Force64BitFPUPrecision();

View File

@@ -207,6 +207,11 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(float)) * EMBEDDED_REDUCTION_FACTOR;
}
if( gIsEmbedded)
float_ulps = f->float_embedded_ulps;
else
@@ -480,6 +485,11 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode)
{
step = (1ULL<<32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
step = (BUFFER_SIZE / sizeof(double)) * EMBEDDED_REDUCTION_FACTOR;
}
Force64BitFPUPrecision();
// Init the kernels