Added helper functions for bruteforce step and scale.

This commit is contained in:
Jeremy Kemp
2020-12-01 10:36:24 +00:00
parent bb6e8eabcc
commit 1e4d19bb1a
11 changed files with 53 additions and 146 deletions

View File

@@ -229,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 setTestScale(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 setTestStep(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 */