fix warning, make output nicer

This commit is contained in:
TiborGY 2019-06-01 20:57:45 +02:00 committed by GitHub
parent 83ceef6fa3
commit 9b77de8d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ int main(int argc, char* argv[]){
//PrintMatrices(matBlock, randomMatSize, numConcurrentThreads, 3); //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){ //i is the index of matrix A, for a given thread 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 < static_cast<uint32_t>(randomMatSize*randomMatSize); j++){
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 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! Index : "<<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;
@ -85,8 +85,8 @@ int main(int argc, char* argv[]){
} }
} }
} }
std::cout<<"OK!"<<std::endl; std::cout<<"OK!\n"<<std::endl;
} }
std::cout<<"CBLAS DGEMM thread safety test PASSED!"<<std::endl; std::cout<<"CBLAS DGEMM thread safety test PASSED!\n"<<std::endl;
return 0; return 0;
} }