diff --git a/cpp_thread_test/dgemv_thread_safety.cpp b/cpp_thread_test/dgemv_thread_safety.cpp index 20ea38138..a48d9c279 100644 --- a/cpp_thread_test/dgemv_thread_safety.cpp +++ b/cpp_thread_test/dgemv_thread_safety.cpp @@ -6,12 +6,14 @@ #include "../cblas.h" #include "cpp_thread_safety_common.h" -void launch_cblas_dgemv(double* A, double* x, double* y, const blasint randomMatSize){ +void launch_cblas_dgemv(double* A, double* x, double* y, const blasint randomMatSize) + { const blasint inc = 1; cblas_dgemv(CblasColMajor, CblasNoTrans, randomMatSize, randomMatSize, 1.0, A, randomMatSize, x, inc, 0.1, y, inc); -} + } -int main(int argc, char* argv[]){ +int main(int argc, char* argv[]) + { blasint randomMatSize = 1024; //dimension of the random square matrices and vectors being used uint32_t numConcurrentThreads = 52; //number of concurrent calls of the functions being tested uint32_t numTestRounds = 16; //number of testing rounds before success exit @@ -20,20 +22,23 @@ int main(int argc, char* argv[]){ if (maxHwThreads < 52) numConcurrentThreads = maxHwThreads; - if (argc > 4){ + if (argc > 4) + { std::cout<<"ERROR: too many arguments for thread safety tester"< cliArgs; - for (int i = 1; i < argc; i++){ + for (int i = 1; i < argc; i++) + { cliArgs.push_back(argv[i]); std::cout< rngdist{-1.0, 1.0}; std::vector> matBlock(numConcurrentThreads); @@ -56,15 +61,18 @@ int main(int argc, char* argv[]){ std::cout<<"Preparing to test CBLAS DGEMV thread safety\n"; std::cout<<"Allocating matrices..."<(randomMatSize); j++){ + for(uint32_t j = 0; j < static_cast(randomMatSize); j++) + { if (std::abs(vecBlock[i+1][j] - vecBlock[1][j]) > 1.0E-13){ //i+1 is the index of vector y, for a given thread std::cout<<"ERROR: one of the threads returned a different result! Index : "<