diff options
Diffstat (limited to 'fastos/src/tests')
-rw-r--r-- | fastos/src/tests/.gitignore | 4 | ||||
-rw-r--r-- | fastos/src/tests/CMakeLists.txt | 7 | ||||
-rw-r--r-- | fastos/src/tests/prefetchtest.cpp | 153 |
3 files changed, 0 insertions, 164 deletions
diff --git a/fastos/src/tests/.gitignore b/fastos/src/tests/.gitignore index 2af862d201e..ccb5f0210ab 100644 --- a/fastos/src/tests/.gitignore +++ b/fastos/src/tests/.gitignore @@ -3,10 +3,6 @@ /backtracetest.log /filetest /filetest.log -/gmtime -/gmtime.log -/prefetchtest -/prefetchtest.log /processtest /processtest.log /sockettest diff --git a/fastos/src/tests/CMakeLists.txt b/fastos/src/tests/CMakeLists.txt index 6166e4273e6..0a1eddf5262 100644 --- a/fastos/src/tests/CMakeLists.txt +++ b/fastos/src/tests/CMakeLists.txt @@ -5,13 +5,6 @@ vespa_add_executable(fastos_processtest_app TEST DEPENDS fastos ) -vespa_add_executable(fastos_prefetchtest_app TEST - SOURCES - prefetchtest.cpp - DEPENDS - fastos -) -vespa_add_test(NAME fastos_prefetchtest_app NO_VALGRIND COMMAND fastos_prefetchtest_app) vespa_add_executable(fastos_filetest_app TEST SOURCES filetest.cpp diff --git a/fastos/src/tests/prefetchtest.cpp b/fastos/src/tests/prefetchtest.cpp deleted file mode 100644 index fba57e4048f..00000000000 --- a/fastos/src/tests/prefetchtest.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/* - * FastOS_Prefetch test program. - * - * Author: Olaf Birkeland - */ - -#include "tests.h" -#include <vespa/fastos/time.h> -#include <vespa/fastos/prefetch.h> - -class PrefetchTestApp : public BaseTest -{ -public: - virtual ~PrefetchTestApp() {} - - bool PrefetchTest () - { - bool rc = false; - int j, size, *a; - int or1, or2; - FastOS_Time start, stop; - double timeVal; - - TestHeader("Prefetch Test"); - - // 32MB - size = 32; - size *= 1024*1024/sizeof(*a); - - if ((a = static_cast<int *>(calloc(size, sizeof(*a)))) != nullptr) - { - // Standard loop - start.SetNow(); - or1 = 1; - for(j=0; j<size; j++) - or1 |= a[j]; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1==1, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (standard loop)", - float(size*sizeof(*a)/(1E3*timeVal))); - - - // Unrolled loop - start.SetNow(); - or1 = or2 = 2; - for(j=0; j<size; j+=8) - { - or1 |= a[j+0]|a[j+1]|a[j+2]|a[j+3]; - or2 |= a[j+4]|a[j+5]|a[j+6]|a[j+7]; - } - or1 |= or2; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1 == 2, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (unrolled loop)", - float(size*sizeof(*a)/(1E3*timeVal))); - - - // Unrolled loop with prefetch - start.SetNow(); - or1 = or2 = 3; - for(j=0; j<size; j+=8) - { - FastOS_Prefetch::NT(&a[j+32]); - or1 |= a[j+0]|a[j+1]|a[j+2]|a[j+3]; - or2 |= a[j+4]|a[j+5]|a[j+6]|a[j+7]; - } - or1 |= or2; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1 == 3, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (unrolled loop with prefetch)", - float(size*sizeof(*a)/(1E3*timeVal))); - - // Unrolled loop - start.SetNow(); - or1 = or2 = 4; - for(j=0; j<size; j+=8) - { - or1 |= a[j+0]|a[j+1]|a[j+2]|a[j+3]; - or2 |= a[j+4]|a[j+5]|a[j+6]|a[j+7]; - } - or1 |= or2; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1 == 4, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (unrolled loop)", - float(size*sizeof(*a)/(1E3*timeVal))); - - - // Standard loop - start.SetNow(); - or1 = 5; - for(j=0; j<size; j++) - or1 |= a[j]; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1 == 5, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (standard loop)", - float(size*sizeof(*a)/(1E3*timeVal))); - - - // Unrolled loop with prefetch - start.SetNow(); - or1 = or2 = 6; - for(j=0; j<size; j+=8) - { - FastOS_Prefetch::NT(&a[j+32]); - or1 |= a[j+0]|a[j+1]|a[j+2]|a[j+3]; - or2 |= a[j+4]|a[j+5]|a[j+6]|a[j+7]; - } - or1 |= or2; - stop.SetNow(); - timeVal = stop.MilliSecs() - start.MilliSecs(); - Progress(or1 == 6, "Result = %d", or1); - ProgressFloat(true, "%4.3f MB/s (unrolled loop with prefetch)", - float(size*sizeof(*a)/(1E3*timeVal))); - - - free(a); - rc = true; - } - else - Progress(false, "Out of memory!!"); - - PrintSeparator(); - - return rc; - } - - int Main () override - { - int rc = 1; - printf("grep for the string '%s' to detect failures.\n\n", failString); - - if(PrefetchTest()) - rc = 0; - - printf("END OF TEST (%s)\n", _argv[0]); - - return rc; - } -}; - - -int main (int argc, char **argv) -{ - PrefetchTestApp app; - setvbuf(stdout, nullptr, _IOLBF, 8192); - return app.Entry(argc, argv); -} |