Blame SOURCES/openblas-0.3.10-concurrency.patch

170ebb
diff --git a/cpp_thread_test/cpp_thread_safety_common.h b/cpp_thread_test/cpp_thread_safety_common.h
170ebb
index 60ab5bb..8005369 100644
170ebb
--- a/cpp_thread_test/cpp_thread_safety_common.h
170ebb
+++ b/cpp_thread_test/cpp_thread_safety_common.h
170ebb
@@ -5,6 +5,14 @@ inline void pauser(){
170ebb
     std::getline(std::cin, dummy);
170ebb
 }
170ebb
 
170ebb
+void FailIfThreadsAreZero(uint32_t numConcurrentThreads) {
170ebb
+	if(numConcurrentThreads == 0) {
170ebb
+		std::cout<<"ERROR: Invalid parameter 0 for number of concurrent calls into OpenBLAS!"<
170ebb
+		std::cout<<"CBLAS DGEMV thread safety test FAILED!"<
170ebb
+		exit(-1);
170ebb
+	}
170ebb
+}
170ebb
+
170ebb
 void FillMatrices(std::vector<std::vector<double>>& matBlock, std::mt19937_64& PRNG, std::uniform_real_distribution<double>& rngdist, const blasint randomMatSize, const uint32_t numConcurrentThreads, const uint32_t numMat){
170ebb
 	for(uint32_t i=0; i
170ebb
 		for(uint32_t j = 0; j < static_cast<uint32_t>(randomMatSize*randomMatSize); j++){
170ebb
diff --git a/cpp_thread_test/dgemm_thread_safety.cpp b/cpp_thread_test/dgemm_thread_safety.cpp
170ebb
index 1c52875..104c64f 100644
170ebb
--- a/cpp_thread_test/dgemm_thread_safety.cpp
170ebb
+++ b/cpp_thread_test/dgemm_thread_safety.cpp
170ebb
@@ -46,6 +46,8 @@ int main(int argc, char* argv[]){
170ebb
 	std::cout<<"Number of concurrent calls into OpenBLAS : "<
170ebb
 	std::cout<<"Number of testing rounds : "<
170ebb
 	std::cout<<"This test will need "<<(static_cast<uint64_t>(randomMatSize*randomMatSize)*numConcurrentThreads*3*8)/static_cast<double>(1024*1024)<<" MiB of RAM\n"<
170ebb
+
170ebb
+	FailIfThreadsAreZero(numConcurrentThreads);
170ebb
 	
170ebb
 	std::cout<<"Initializing random number generator..."<
170ebb
 	std::mt19937_64 PRNG = InitPRNG();
170ebb
diff --git a/cpp_thread_test/dgemv_thread_safety.cpp b/cpp_thread_test/dgemv_thread_safety.cpp
170ebb
index 5411fec..20ea381 100644
170ebb
--- a/cpp_thread_test/dgemv_thread_safety.cpp
170ebb
+++ b/cpp_thread_test/dgemv_thread_safety.cpp
170ebb
@@ -18,7 +18,7 @@ int main(int argc, char* argv[]){
170ebb
 	uint32_t maxHwThreads = omp_get_max_threads();
170ebb
 	
170ebb
 	if (maxHwThreads < 52)
170ebb
-		numConcurrentThreads = maxHwThreads -4;
170ebb
+		numConcurrentThreads = maxHwThreads;
170ebb
 	
170ebb
 	if (argc > 4){
170ebb
 		std::cout<<"ERROR: too many arguments for thread safety tester"<
170ebb
@@ -47,6 +47,8 @@ int main(int argc, char* argv[]){
170ebb
 	std::cout<<"Number of concurrent calls into OpenBLAS : "<
170ebb
 	std::cout<<"Number of testing rounds : "<
170ebb
 	std::cout<<"This test will need "<<((static_cast<uint64_t>(randomMatSize*randomMatSize)*numConcurrentThreads*8)+(static_cast<uint64_t>(randomMatSize)*numConcurrentThreads*8*2))/static_cast<double>(1024*1024)<<" MiB of RAM\n"<
170ebb
+
170ebb
+	FailIfThreadsAreZero(numConcurrentThreads);
170ebb
 	
170ebb
 	std::cout<<"Initializing random number generator..."<
170ebb
 	std::mt19937_64 PRNG = InitPRNG();