// ================================================================================================= // This file is part of the CodeVault project. The project is licensed under Apache Version 2.0. // CodeVault is part of the EU-project PRACE-4IP (WP7.3.C). // // Author(s): // Mariusz Uchronski // // This example demonstrates the use of C++ threads for matrix-matrix multiplication. // The example is set-up to perform single precision matrix-matrix multiplication. // // See [http://www.cplusplus.com/reference/thread/thread/] for the full C++ threads documentation. // // ================================================================================================= #include #include #include #include #include void fill_random(float *a, const int &n, const int &m) { std::mt19937 e(static_cast(time(nullptr))); std::uniform_real_distribution f; for(int i=0; i threads; float *a = new float[n*m]; float *b = new float[m*k]; float *c = new float[n*k]; fill_random(a, n, m); fill_random(b, m, k); for(int i=0; i