Restored the embedded reduction factor to bruteforce. (#1052)

* 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

* Added helper functions for bruteforce step and scale.

* Added missing files from 1e4d19b.

* Renamed getTestScale and getTestStep to set*.
This commit is contained in:
Jeremy Kemp
2021-01-07 11:34:58 +00:00
committed by GitHub
parent 25d9ff5d6e
commit 904fb419ee
14 changed files with 73 additions and 95 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))
@@ -228,6 +229,36 @@ void logFunctionInfo(const char *fname, unsigned int float_size, unsigned int is
float getAllowedUlpError(const Func *f, const bool relaxed);
static inline cl_uint getTestScale(size_t typeSize)
{
if (gWimpyMode)
{
return (cl_uint)typeSize * 2 * gWimpyReductionFactor;
}
else if (gIsEmbedded)
{
return EMBEDDED_REDUCTION_FACTOR;
}
else
{
return 1;
}
}
static inline uint64_t getTestStep(size_t typeSize, size_t bufferSize)
{
if (gWimpyMode)
{
return (1ULL << 32) * gWimpyReductionFactor / (512);
}
else if (gIsEmbedded)
{
return (BUFFER_SIZE / typeSize) * EMBEDDED_REDUCTION_FACTOR;
}
else
{
return bufferSize / typeSize;
}
}
#endif /* UTILITY_H */