mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Refactor wimpy feature (#2507)
- Make it a common parameter in harness using either '-w', '--wimpy' or 'CL_WIMPY_MODE' environment variable. - Remove all test specific wimpy variable. --------- Co-authored-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -36,6 +36,7 @@ bool gDisableSPIRVValidation = false;
|
||||
std::string gSPIRVValidator = DEFAULT_SPIRV_VALIDATOR;
|
||||
unsigned gNumWorkerThreads;
|
||||
bool gListTests = false;
|
||||
bool gWimpyMode = false;
|
||||
|
||||
void helpInfo()
|
||||
{
|
||||
@@ -52,6 +53,10 @@ void helpInfo()
|
||||
Select parallel execution with the specified number of worker threads.
|
||||
--list
|
||||
List sub-tests
|
||||
-w, --wimpy
|
||||
Enable wimpy mode. It does not impact all tests. Impacted tests will run
|
||||
with a very small subset of the tests. This option should not be used
|
||||
for conformance submission (default: disabled).
|
||||
|
||||
For offline compilation (binary and spir-v modes) only:
|
||||
--compilation-cache-mode <cache-mode>
|
||||
@@ -112,6 +117,11 @@ int parseCustomParam(int argc, const char *argv[], const char *ignore)
|
||||
delArg++;
|
||||
gListTests = true;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--wimpy") || !strcmp(argv[i], "-w"))
|
||||
{
|
||||
delArg++;
|
||||
gWimpyMode = true;
|
||||
}
|
||||
else if (!strcmp(argv[i], "--compilation-mode"))
|
||||
{
|
||||
delArg++;
|
||||
|
||||
@@ -41,6 +41,7 @@ extern std::string gCompilationProgram;
|
||||
extern bool gDisableSPIRVValidation;
|
||||
extern std::string gSPIRVValidator;
|
||||
extern bool gListTests;
|
||||
extern bool gWimpyMode;
|
||||
|
||||
extern int parseCustomParam(int argc, const char *argv[],
|
||||
const char *ignore = 0);
|
||||
|
||||
@@ -278,6 +278,16 @@ int runTestHarnessWithCheck(int argc, const char *argv[], int testNum,
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
gWimpyMode |= (getenv("CL_WIMPY_MODE") != nullptr);
|
||||
if (gWimpyMode)
|
||||
{
|
||||
log_info("\n");
|
||||
log_info("**************************\n");
|
||||
log_info("*** Wimpy mode enabled ***\n");
|
||||
log_info("**************************\n");
|
||||
log_info("\n");
|
||||
}
|
||||
|
||||
if ((argc > 1) && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
|
||||
{
|
||||
char *fileName = getenv("CL_CONFORMANCE_RESULTS_FILENAME");
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/compat.h"
|
||||
#include "harness/ThreadPool.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <sys/sysctl.h>
|
||||
@@ -77,7 +78,6 @@ cl_mem gInBuffer;
|
||||
cl_mem gOutBuffers[kCallStyleCount];
|
||||
size_t gComputeDevices = 0;
|
||||
uint32_t gDeviceFrequency = 0;
|
||||
int gWimpyMode = 0;
|
||||
int gWimpyReductionFactor = 128;
|
||||
int gSkipTesting = 0;
|
||||
int gForceFTZ = 0;
|
||||
|
||||
@@ -80,7 +80,6 @@ extern int gHasDouble;
|
||||
extern int gTestDouble;
|
||||
extern int gHasHalfs;
|
||||
extern int gTestHalfs;
|
||||
extern int gWimpyMode;
|
||||
extern int gWimpyReductionFactor;
|
||||
extern int gSkipTesting;
|
||||
extern int gMinVectorSize;
|
||||
|
||||
@@ -247,7 +247,6 @@ static int ParseArgs(int argc, const char **argv)
|
||||
case 'h': gTestHalfs ^= 1; break;
|
||||
case 'l': gSkipTesting ^= 1; break;
|
||||
case 'm': gMultithread ^= 1; break;
|
||||
case 'w': gWimpyMode ^= 1; break;
|
||||
case '[':
|
||||
parseWimpyReductionFactor(arg, gWimpyReductionFactor);
|
||||
break;
|
||||
@@ -316,14 +315,6 @@ static int ParseArgs(int argc, const char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
// Check for the wimpy mode environment variable
|
||||
if (getenv("CL_WIMPY_MODE"))
|
||||
{
|
||||
vlog("\n");
|
||||
vlog("*** Detected CL_WIMPY_MODE env ***\n");
|
||||
gWimpyMode = 1;
|
||||
}
|
||||
|
||||
vlog("\n");
|
||||
|
||||
PrintArch();
|
||||
@@ -364,9 +355,6 @@ static void PrintUsage(void)
|
||||
vlog("\t\t-l\tToggle link check mode. When on, testing is skipped, and we "
|
||||
"just check to see that the kernels build. (Off by default.)\n");
|
||||
vlog("\t\t-m\tToggle Multithreading. (On by default.)\n");
|
||||
vlog("\t\t-w\tToggle wimpy mode. When wimpy mode is on, we run a very "
|
||||
"small subset of the tests for each fn. NOT A VALID TEST! (Off by "
|
||||
"default.)\n");
|
||||
vlog(" \t\t-[2^n]\tSet wimpy reduction factor, recommended range of n is "
|
||||
"1-12, default factor(%u)\n",
|
||||
gWimpyReductionFactor);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -25,7 +26,6 @@
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
|
||||
// clang-format off
|
||||
static const char* enqueue_simple_block[] = { R"(
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -25,7 +26,6 @@
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
#define BITS_DEPTH 28
|
||||
|
||||
static const char* enqueue_flags_wait_kernel_simple[] =
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -24,10 +25,7 @@
|
||||
#include <time.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
static const char enqueue_block_multi_queue[] =
|
||||
NL "#define BLOCK_COMPLETED 0"
|
||||
NL "#define BLOCK_SUBMITTED 1"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
@@ -26,7 +27,6 @@
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
static const char *helper_ndrange_1d_glo[] = {
|
||||
NL,
|
||||
"void block_fn(int len, __global atomic_uint* val)" NL,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -25,7 +26,6 @@
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
static int nestingLevel = 3;
|
||||
|
||||
static const char* enqueue_1D_wg_size_single[] =
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -25,7 +26,6 @@
|
||||
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
extern int gWimpyMode;
|
||||
static const char* multi_queue_simple_block1[] =
|
||||
{
|
||||
NL, "void block_fn(size_t tid, int mul, __global int* res)"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
@@ -24,8 +25,6 @@
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
extern int gWimpyMode;
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
|
||||
static const char* enqueue_block_first_kernel[] =
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "utils.h"
|
||||
|
||||
std::string gKernelName;
|
||||
int gWimpyMode = 0;
|
||||
|
||||
test_status InitCL(cl_device_id device) {
|
||||
auto version = get_device_cl_version(device);
|
||||
@@ -71,11 +70,6 @@ int main(int argc, const char *argv[])
|
||||
gKernelName = std::string(argv[i + 1]);
|
||||
argsRemoveNum += 2;
|
||||
}
|
||||
if (strcmp(argv[i], "-w") == 0 ){
|
||||
gWimpyMode = 1;
|
||||
argsRemoveNum += 1;
|
||||
}
|
||||
|
||||
|
||||
if (argsRemoveNum > 0) {
|
||||
for (int j = i; j < (argc - argsRemoveNum); ++j)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -27,7 +28,6 @@
|
||||
#ifdef CL_VERSION_2_0
|
||||
|
||||
static int gNestingLevel = 4;
|
||||
extern int gWimpyMode;
|
||||
|
||||
static const char* enqueue_nested_blocks_single[] =
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "harness/compat.h"
|
||||
#include "harness/kernelHelpers.h"
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ uint32_t gDeviceFrequency = 0;
|
||||
uint32_t gComputeDevices = 0;
|
||||
size_t gMaxThreadGroupSize = 0;
|
||||
size_t gWorkGroupSize = 0;
|
||||
bool gWimpyMode = false;
|
||||
int gWimpyReductionFactor = 512;
|
||||
int gTestDouble = 0;
|
||||
bool gHostReset = false;
|
||||
|
||||
@@ -74,7 +74,6 @@ extern bool gHostReset;
|
||||
// gWimpyMode indicates if we run the test in wimpy mode where we limit the
|
||||
// size of 32 bit ranges to a much smaller set. This is meant to be used
|
||||
// as a smoke test
|
||||
extern bool gWimpyMode;
|
||||
extern int gWimpyReductionFactor;
|
||||
|
||||
uint64_t ReadTime( void );
|
||||
|
||||
@@ -178,9 +178,6 @@ static int ParseArgs( int argc, const char **argv )
|
||||
|
||||
case 'r': gHostReset = true; break;
|
||||
|
||||
case 'w': // Wimpy mode
|
||||
gWimpyMode = true;
|
||||
break;
|
||||
case '[':
|
||||
parseWimpyReductionFactor( arg, gWimpyReductionFactor);
|
||||
break;
|
||||
@@ -199,12 +196,6 @@ static int ParseArgs( int argc, const char **argv )
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv("CL_WIMPY_MODE")) {
|
||||
vlog( "\n" );
|
||||
vlog( "*** Detected CL_WIMPY_MODE env ***\n" );
|
||||
gWimpyMode = 1;
|
||||
}
|
||||
|
||||
PrintArch();
|
||||
if( gWimpyMode )
|
||||
{
|
||||
@@ -234,7 +225,6 @@ static void PrintUsage( void )
|
||||
"supported)\n");
|
||||
vlog("\t\t-t\tToggle reporting performance data.\n");
|
||||
vlog("\t\t-r\tReset buffers on host instead of on device.\n");
|
||||
vlog("\t\t-w\tRun in wimpy mode\n");
|
||||
vlog("\t\t-[2^n]\tSet wimpy reduction factor, recommended range of n is "
|
||||
"1-12, default factor(%u)\n",
|
||||
gWimpyReductionFactor);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/ThreadPool.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#define NUM_TESTS 23
|
||||
|
||||
@@ -823,9 +824,9 @@ int run_specific_test(cl_device_id deviceID, cl_context context, cl_command_queu
|
||||
int run_multiple_tests(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements, ExplicitType type, int num, int *tests, int total_tests) {
|
||||
int errors = 0;
|
||||
|
||||
if (getenv("CL_WIMPY_MODE") && num == LONG_MATH_SHIFT_SIZE) {
|
||||
log_info("Detected CL_WIMPY_MODE env\n");
|
||||
log_info("Skipping long test\n");
|
||||
if (gWimpyMode && num == LONG_MATH_SHIFT_SIZE)
|
||||
{
|
||||
log_info("Running in wimpy mode, skipping long test\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ int gSkipCorrectnessTesting = 0;
|
||||
static int gStopOnError = 0;
|
||||
static bool gSkipRestOfTests;
|
||||
int gForceFTZ = 0;
|
||||
int gWimpyMode = 0;
|
||||
int gHostFill = 0;
|
||||
static int gHasDouble = 0;
|
||||
static int gTestFloat = 1;
|
||||
@@ -502,10 +501,6 @@ static int ParseArgs(int argc, const char **argv)
|
||||
|
||||
case 'v': gVerboseBruteForce ^= 1; break;
|
||||
|
||||
case 'w': // wimpy mode
|
||||
gWimpyMode ^= 1;
|
||||
break;
|
||||
|
||||
case '[':
|
||||
parseWimpyReductionFactor(arg, gWimpyReductionFactor);
|
||||
break;
|
||||
@@ -585,14 +580,6 @@ static int ParseArgs(int argc, const char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
// Check for the wimpy mode environment variable
|
||||
if (getenv("CL_WIMPY_MODE"))
|
||||
{
|
||||
vlog("\n");
|
||||
vlog("*** Detected CL_WIMPY_MODE env ***\n");
|
||||
gWimpyMode = 1;
|
||||
}
|
||||
|
||||
PrintArch();
|
||||
|
||||
if (gWimpyMode)
|
||||
@@ -647,7 +634,6 @@ static void PrintUsage(void)
|
||||
"accuracy checks.)\n");
|
||||
vlog("\t\t-m\tToggle run multi-threaded. (Default: on) )\n");
|
||||
vlog("\t\t-s\tStop on error\n");
|
||||
vlog("\t\t-w\tToggle Wimpy Mode, * Not a valid test * \n");
|
||||
vlog("\t\t-[2^n]\tSet wimpy reduction factor, recommended range of n is "
|
||||
"1-10, default factor(%u)\n",
|
||||
gWimpyReductionFactor);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/ThreadPool.h"
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/parseParameters.h"
|
||||
#include "CL/cl_half.h"
|
||||
|
||||
#define BUFFER_SIZE (1024 * 1024 * 2)
|
||||
@@ -60,7 +61,6 @@ extern cl_mem gOutBuffer2[VECTOR_SIZE_COUNT];
|
||||
extern int gSkipCorrectnessTesting;
|
||||
extern int gForceFTZ;
|
||||
extern int gFastRelaxedDerived;
|
||||
extern int gWimpyMode;
|
||||
extern int gHostFill;
|
||||
extern int gIsInRTZMode;
|
||||
extern int gHasHalf;
|
||||
|
||||
@@ -89,7 +89,6 @@ static void printUsage( void );
|
||||
// test their entire range and 64 bits test will test the 32 bit
|
||||
// range. Otherwise, we test a subset of the range
|
||||
// [-min_short, min_short]
|
||||
static bool s_wimpy_mode = false;
|
||||
static int s_wimpy_reduction_factor = 256;
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -141,8 +140,9 @@ static void initCmpBuffer(void *cmp, Type cmptype, uint64_t start,
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
if (!s_wimpy_mode) {
|
||||
uint32_t* ui = (uint32_t *)cmp;
|
||||
if (!gWimpyMode)
|
||||
{
|
||||
uint32_t *ui = (uint32_t *)cmp;
|
||||
for (size_t i = 0; i < count; ++i) ui[i] = (uint32_t)start++;
|
||||
}
|
||||
else {
|
||||
@@ -323,7 +323,7 @@ static int doTest(cl_command_queue queue, cl_context context, Type stype, Type c
|
||||
|
||||
cl_ulong blocks = type_size[stype] * 0x100000000ULL / BUFFER_SIZE;
|
||||
const size_t block_elements = BUFFER_SIZE / type_size[stype];
|
||||
size_t step = s_wimpy_mode ? s_wimpy_reduction_factor : 1;
|
||||
size_t step = gWimpyMode ? s_wimpy_reduction_factor : 1;
|
||||
cl_ulong cmp_stride = block_elements * step;
|
||||
|
||||
// It is more efficient to create the tests all at once since we
|
||||
@@ -474,7 +474,7 @@ static int doTest(cl_command_queue queue, cl_context context, Type stype, Type c
|
||||
} // for vecsize
|
||||
} // for i
|
||||
|
||||
if (!s_wimpy_mode)
|
||||
if (!gWimpyMode)
|
||||
log_info(" Passed\n\n");
|
||||
else
|
||||
log_info(" Wimpy Passed\n\n");
|
||||
@@ -603,13 +603,9 @@ int main(int argc, const char* argv[])
|
||||
arg++;
|
||||
while(*arg != '\0')
|
||||
{
|
||||
switch(*arg) {
|
||||
case 'h':
|
||||
printUsage();
|
||||
return 0;
|
||||
case 'w':
|
||||
s_wimpy_mode = true;
|
||||
break;
|
||||
switch (*arg)
|
||||
{
|
||||
case 'h': printUsage(); return 0;
|
||||
case '[':
|
||||
parseWimpyReductionFactor(arg, s_wimpy_reduction_factor);
|
||||
break;
|
||||
@@ -626,11 +622,7 @@ int main(int argc, const char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv("CL_WIMPY_MODE")) {
|
||||
s_wimpy_mode = true;
|
||||
}
|
||||
|
||||
if (s_wimpy_mode && !gListTests)
|
||||
if (gWimpyMode && !gListTests)
|
||||
{
|
||||
log_info("\n");
|
||||
log_info("*** WARNING: Testing in Wimpy mode! ***\n");
|
||||
@@ -652,7 +644,6 @@ static void printUsage( void )
|
||||
{
|
||||
log_info("test_select: [-w] <optional: test_names> \n");
|
||||
log_info("\tdefault is to run the full test on the default device\n");
|
||||
log_info("\t-w run in wimpy mode (smoke test)\n");
|
||||
log_info("\t-[2^n] Set wimpy reduction factor, recommended range of n is 1-12, default factor(%u)\n", s_wimpy_reduction_factor);
|
||||
log_info("\n");
|
||||
log_info("Test names:\n");
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "harness/errorHelpers.h"
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/mt19937.h"
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -524,9 +525,9 @@ int test_thread_dimensions(cl_device_id device, cl_context context,
|
||||
cl_uint max_x_size = 1, min_x_size = 1, max_y_size = 1, min_y_size = 1,
|
||||
max_z_size = 1, min_z_size = 1;
|
||||
|
||||
if (getenv("CL_WIMPY_MODE") && !quick_test)
|
||||
if (gWimpyMode && !quick_test)
|
||||
{
|
||||
log_info("CL_WIMPY_MODE enabled, skipping test\n");
|
||||
log_info("Wimpy mode enabled, skipping test\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
extern int g_arrVecSizes[NUM_VECTOR_SIZES];
|
||||
extern int g_arrVecSteps[NUM_VECTOR_SIZES];
|
||||
extern bool g_wimpyMode;
|
||||
|
||||
extern const char *g_arrVecSizeNames[NUM_VECTOR_SIZES];
|
||||
extern size_t g_arrVecAlignMasks[NUM_VECTOR_SIZES];
|
||||
|
||||
@@ -32,8 +32,6 @@ size_t g_arrVecAlignMasks[NUM_VECTOR_SIZES] = {
|
||||
(size_t)0xf // 16
|
||||
};
|
||||
|
||||
bool g_wimpyMode = false;
|
||||
|
||||
ExplicitType types[] = {
|
||||
kChar, kUChar, kShort, kUShort, kInt, kUInt, kLong,
|
||||
kULong, kFloat, kDouble, kNumExplicitTypes
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
#include "harness/parseParameters.h"
|
||||
|
||||
#define DEBUG_MEM_ALLOC 0
|
||||
|
||||
/** typedef struct _bufferStruct
|
||||
@@ -223,7 +225,7 @@ void initContents(bufferStruct *pBufferStruct, clState *pClState,
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
if (!g_wimpyMode)
|
||||
if (!gWimpyMode)
|
||||
{
|
||||
uint32_t *ui = (uint32_t *)(pBufferStruct->m_pIn);
|
||||
for (i = 0; i < countIn; ++i)
|
||||
|
||||
Reference in New Issue
Block a user