upload (1/3)
This commit is contained in:
parent
7d687f202e
commit
b7529505c0
|
@ -55,8 +55,8 @@ int main(int argc, char* argv[]){
|
||||||
std::cout<<"done\n";
|
std::cout<<"done\n";
|
||||||
//pauser();
|
//pauser();
|
||||||
std::cout<<"Filling matrices with random numbers..."<<std::flush;
|
std::cout<<"Filling matrices with random numbers..."<<std::flush;
|
||||||
FillMatrices(matBlock, PRNG, rngdist, randomMatSize, numConcurrentThreads);
|
FillMatrices(matBlock, PRNG, rngdist, randomMatSize, numConcurrentThreads, 3);
|
||||||
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads);
|
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads, 3);
|
||||||
std::cout<<"done\n";
|
std::cout<<"done\n";
|
||||||
std::cout<<"Testing CBLAS DGEMM thread safety\n";
|
std::cout<<"Testing CBLAS DGEMM thread safety\n";
|
||||||
omp_set_num_threads(numConcurrentThreads);
|
omp_set_num_threads(numConcurrentThreads);
|
||||||
|
@ -74,12 +74,12 @@ int main(int argc, char* argv[]){
|
||||||
futureBlock[i].get();
|
futureBlock[i].get();
|
||||||
}
|
}
|
||||||
std::cout<<"done\n";
|
std::cout<<"done\n";
|
||||||
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads);
|
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads, 3);
|
||||||
std::cout<<"Comparing results from different threads..."<<std::flush;
|
std::cout<<"Comparing results from different threads..."<<std::flush;
|
||||||
for(uint32_t i=3; i<(numConcurrentThreads*3); i+=3){
|
for(uint32_t i=3; i<(numConcurrentThreads*3); i+=3){ //i is the index of matrix A, for a given thread
|
||||||
for(uint32_t j=0; j<(randomMatSize*randomMatSize); j++){
|
for(uint32_t j=0; j<(randomMatSize*randomMatSize); j++){
|
||||||
if (std::abs(matBlock[i+2][j] - matBlock[2][j]) > 1.0E-13){
|
if (std::abs(matBlock[i+2][j] - matBlock[2][j]) > 1.0E-13){ //i+2 is the index of matrix C, for a given thread
|
||||||
std::cout<<"ERROR: one of the threads returned a different result!"<<i+2<<std::endl;
|
std::cout<<"ERROR: one of the threads returned a different result! Index : "<<i+2<<std::endl;
|
||||||
std::cout<<"CBLAS DGEMM thread safety test FAILED!"<<std::endl;
|
std::cout<<"CBLAS DGEMM thread safety test FAILED!"<<std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue