diff --git a/test_common/harness/parseParameters.cpp b/test_common/harness/parseParameters.cpp index 820814ec..65167116 100644 --- a/test_common/harness/parseParameters.cpp +++ b/test_common/harness/parseParameters.cpp @@ -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 @@ -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++; diff --git a/test_common/harness/parseParameters.h b/test_common/harness/parseParameters.h index 685aef21..ef8a7cb6 100644 --- a/test_common/harness/parseParameters.h +++ b/test_common/harness/parseParameters.h @@ -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); diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp index 71430cd0..c745a639 100644 --- a/test_common/harness/testHarness.cpp +++ b/test_common/harness/testHarness.cpp @@ -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"); diff --git a/test_conformance/conversions/basic_test_conversions.cpp b/test_conformance/conversions/basic_test_conversions.cpp index 4692c4b4..79333275 100644 --- a/test_conformance/conversions/basic_test_conversions.cpp +++ b/test_conformance/conversions/basic_test_conversions.cpp @@ -17,6 +17,7 @@ #include "harness/testHarness.h" #include "harness/compat.h" #include "harness/ThreadPool.h" +#include "harness/parseParameters.h" #if defined(__APPLE__) #include @@ -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; diff --git a/test_conformance/conversions/basic_test_conversions.h b/test_conformance/conversions/basic_test_conversions.h index 56232374..6846f780 100644 --- a/test_conformance/conversions/basic_test_conversions.h +++ b/test_conformance/conversions/basic_test_conversions.h @@ -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; diff --git a/test_conformance/conversions/test_conversions.cpp b/test_conformance/conversions/test_conversions.cpp index 5df5f0fd..7a143a6b 100644 --- a/test_conformance/conversions/test_conversions.cpp +++ b/test_conformance/conversions/test_conversions.cpp @@ -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); diff --git a/test_conformance/device_execution/enqueue_block.cpp b/test_conformance/device_execution/enqueue_block.cpp index c3761d08..10d7b86d 100644 --- a/test_conformance/device_execution/enqueue_block.cpp +++ b/test_conformance/device_execution/enqueue_block.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -25,7 +26,6 @@ #ifdef CL_VERSION_2_0 -extern int gWimpyMode; // clang-format off static const char* enqueue_simple_block[] = { R"( diff --git a/test_conformance/device_execution/enqueue_flags.cpp b/test_conformance/device_execution/enqueue_flags.cpp index d880fadd..35610174 100644 --- a/test_conformance/device_execution/enqueue_flags.cpp +++ b/test_conformance/device_execution/enqueue_flags.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -25,7 +26,6 @@ #ifdef CL_VERSION_2_0 -extern int gWimpyMode; #define BITS_DEPTH 28 static const char* enqueue_flags_wait_kernel_simple[] = diff --git a/test_conformance/device_execution/enqueue_multi_queue.cpp b/test_conformance/device_execution/enqueue_multi_queue.cpp index 90dbf2fd..5caaefa7 100644 --- a/test_conformance/device_execution/enqueue_multi_queue.cpp +++ b/test_conformance/device_execution/enqueue_multi_queue.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -24,10 +25,7 @@ #include - - #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" diff --git a/test_conformance/device_execution/enqueue_ndrange.cpp b/test_conformance/device_execution/enqueue_ndrange.cpp index ffadc0ac..8f71ac4e 100644 --- a/test_conformance/device_execution/enqueue_ndrange.cpp +++ b/test_conformance/device_execution/enqueue_ndrange.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include #include @@ -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, diff --git a/test_conformance/device_execution/enqueue_wg_size.cpp b/test_conformance/device_execution/enqueue_wg_size.cpp index f662edb9..5f40951e 100644 --- a/test_conformance/device_execution/enqueue_wg_size.cpp +++ b/test_conformance/device_execution/enqueue_wg_size.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -25,7 +26,6 @@ #ifdef CL_VERSION_2_0 -extern int gWimpyMode; static int nestingLevel = 3; static const char* enqueue_1D_wg_size_single[] = diff --git a/test_conformance/device_execution/host_multi_queue.cpp b/test_conformance/device_execution/host_multi_queue.cpp index cca83454..13ab87e6 100644 --- a/test_conformance/device_execution/host_multi_queue.cpp +++ b/test_conformance/device_execution/host_multi_queue.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -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)" diff --git a/test_conformance/device_execution/host_queue_order.cpp b/test_conformance/device_execution/host_queue_order.cpp index bafbce08..d235780e 100644 --- a/test_conformance/device_execution/host_queue_order.cpp +++ b/test_conformance/device_execution/host_queue_order.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include #include @@ -24,8 +25,6 @@ #include "utils.h" #include -extern int gWimpyMode; - #ifdef CL_VERSION_2_0 static const char* enqueue_block_first_kernel[] = diff --git a/test_conformance/device_execution/main.cpp b/test_conformance/device_execution/main.cpp index efb311f9..81c19802 100644 --- a/test_conformance/device_execution/main.cpp +++ b/test_conformance/device_execution/main.cpp @@ -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) diff --git a/test_conformance/device_execution/nested_blocks.cpp b/test_conformance/device_execution/nested_blocks.cpp index a191bdf5..9fc2d741 100644 --- a/test_conformance/device_execution/nested_blocks.cpp +++ b/test_conformance/device_execution/nested_blocks.cpp @@ -17,6 +17,7 @@ #include #include "harness/testHarness.h" #include "harness/typeWrappers.h" +#include "harness/parseParameters.h" #include @@ -27,7 +28,6 @@ #ifdef CL_VERSION_2_0 static int gNestingLevel = 4; -extern int gWimpyMode; static const char* enqueue_nested_blocks_single[] = { diff --git a/test_conformance/half/Test_vStoreHalf.cpp b/test_conformance/half/Test_vStoreHalf.cpp index ab7fe257..15b940f5 100644 --- a/test_conformance/half/Test_vStoreHalf.cpp +++ b/test_conformance/half/Test_vStoreHalf.cpp @@ -16,6 +16,7 @@ #include "harness/compat.h" #include "harness/kernelHelpers.h" #include "harness/testHarness.h" +#include "harness/parseParameters.h" #include diff --git a/test_conformance/half/cl_utils.cpp b/test_conformance/half/cl_utils.cpp index 4fd42c02..7090f435 100644 --- a/test_conformance/half/cl_utils.cpp +++ b/test_conformance/half/cl_utils.cpp @@ -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; diff --git a/test_conformance/half/cl_utils.h b/test_conformance/half/cl_utils.h index da6073cf..d7754ebc 100644 --- a/test_conformance/half/cl_utils.h +++ b/test_conformance/half/cl_utils.h @@ -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 ); diff --git a/test_conformance/half/main.cpp b/test_conformance/half/main.cpp index 9d9211c7..0beec938 100644 --- a/test_conformance/half/main.cpp +++ b/test_conformance/half/main.cpp @@ -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); diff --git a/test_conformance/integer_ops/test_int_basic_ops.cpp b/test_conformance/integer_ops/test_int_basic_ops.cpp index b9a47d75..aa48a6ba 100644 --- a/test_conformance/integer_ops/test_int_basic_ops.cpp +++ b/test_conformance/integer_ops/test_int_basic_ops.cpp @@ -22,6 +22,7 @@ #include "harness/conversions.h" #include "harness/ThreadPool.h" +#include "harness/parseParameters.h" #define NUM_TESTS 23 @@ -823,10 +824,10 @@ 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"); - return 0; + if (gWimpyMode && num == LONG_MATH_SHIFT_SIZE) + { + log_info("Running in wimpy mode, skipping long test\n"); + return 0; } int i; diff --git a/test_conformance/math_brute_force/main.cpp b/test_conformance/math_brute_force/main.cpp index 519d8b12..a395488c 100644 --- a/test_conformance/math_brute_force/main.cpp +++ b/test_conformance/math_brute_force/main.cpp @@ -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); diff --git a/test_conformance/math_brute_force/utility.h b/test_conformance/math_brute_force/utility.h index f5a30f86..f735f9d3 100644 --- a/test_conformance/math_brute_force/utility.h +++ b/test_conformance/math_brute_force/utility.h @@ -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; diff --git a/test_conformance/select/test_select.cpp b/test_conformance/select/test_select.cpp index 490fa8bc..bec85e12 100644 --- a/test_conformance/select/test_select.cpp +++ b/test_conformance/select/test_select.cpp @@ -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] \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"); diff --git a/test_conformance/thread_dimensions/test_thread_dimensions.cpp b/test_conformance/thread_dimensions/test_thread_dimensions.cpp index ed163ac7..4dd8c7ae 100644 --- a/test_conformance/thread_dimensions/test_thread_dimensions.cpp +++ b/test_conformance/thread_dimensions/test_thread_dimensions.cpp @@ -19,6 +19,7 @@ #include "harness/errorHelpers.h" #include "harness/conversions.h" #include "harness/mt19937.h" +#include "harness/parseParameters.h" #include #include @@ -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; } diff --git a/test_conformance/vectors/defines.h b/test_conformance/vectors/defines.h index 0ea0b00d..7068cf18 100644 --- a/test_conformance/vectors/defines.h +++ b/test_conformance/vectors/defines.h @@ -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]; diff --git a/test_conformance/vectors/globals.cpp b/test_conformance/vectors/globals.cpp index 6dee6d96..b7da9b6e 100644 --- a/test_conformance/vectors/globals.cpp +++ b/test_conformance/vectors/globals.cpp @@ -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 diff --git a/test_conformance/vectors/structs.cpp b/test_conformance/vectors/structs.cpp index 0098e414..c0757017 100644 --- a/test_conformance/vectors/structs.cpp +++ b/test_conformance/vectors/structs.cpp @@ -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)