#include #include #include #include #include #include "../cblas.h" #include "cpp_thread_safety_common.h" 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[]){ 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 if (argc > 4){ std::cout<<"ERROR: too many arguments for thread safety tester"< cliArgs; for (int i = 1; i < argc; i++){ cliArgs.push_back(argv[i]); std::cout< rngdist{-1.0, 1.0}; std::vector> matBlock(numConcurrentThreads); std::vector> vecBlock(numConcurrentThreads*2); std::vector> futureBlock(numConcurrentThreads); std::cout<<"*----------------------------*\n"; std::cout<<"| DGEMV thread safety tester |\n"; std::cout<<"*----------------------------*\n"; std::cout<<"Size of random matrices and vectors(N=M): "<(randomMatSize*randomMatSize)*numConcurrentThreads*8)+(static_cast(randomMatSize)*numConcurrentThreads*8*2))/static_cast(1024*1024)<<" MiB of RAM\n"<(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 : "<