Browse Source

Match thread count to machine capability

tags/v0.3.10^2
Martin Kroeker GitHub 6 years ago
parent
commit
66f89c0aaf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions
  1. +5
    -1
      cpp_thread_test/dgemm_thread_safety.cpp
  2. +4
    -0
      cpp_thread_test/dgemv_thread_safety.cpp

+ 5
- 1
cpp_thread_test/dgemm_thread_safety.cpp View File

@@ -12,9 +12,13 @@ void launch_cblas_dgemm(double* A, double* B, double* C, const blasint randomMat

int main(int argc, char* argv[]){
blasint randomMatSize = 1024; //dimension of the random square matrices used
uint32_t numConcurrentThreads = 52; //number of concurrent calls of the functions being tested
uint32_t numConcurrentThreads = 96; //number of concurrent calls of the functions being tested
uint32_t numTestRounds = 16; //number of testing rounds before success exit
uint32_t maxHwThreads = omp_get_max_threads();
if (maxHwThreads < 96)
numConcurrentThreads = maxHwThreads;

if (argc > 4){
std::cout<<"ERROR: too many arguments for thread safety tester"<<std::endl;
abort();


+ 4
- 0
cpp_thread_test/dgemv_thread_safety.cpp View File

@@ -15,6 +15,10 @@ 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
uint32_t maxHwThreads = omp_get_max_threads();
if (maxHwThreads < 52)
numConcurrentThreads = maxHwThreads -4;
if (argc > 4){
std::cout<<"ERROR: too many arguments for thread safety tester"<<std::endl;


Loading…
Cancel
Save