10 std::mt19937 gen(rd());
11 std::uniform_real_distribution<float> distribution(1.0, 100.0);
14 matrix[i] = distribution(gen);
19 std::cout << name <<
":\n";
22 std::cout << matrix[i *
matrixSize + j] <<
"\t";
33 std::chrono::steady_clock::time_point gen_start_time =
34 std::chrono::steady_clock::now();
52 std::chrono::steady_clock::time_point mtx_start_time =
53 std::chrono::steady_clock::now();
62 std::chrono::steady_clock::time_point end_time =
63 std::chrono::steady_clock::now();
68 std::cout <<
"Generating random matrices (ARRAYS) - Time elapsed: "
69 << std::chrono::duration_cast<std::chrono::milliseconds>(
70 mtx_start_time - gen_start_time)
72 <<
" ms" << std::endl;
74 std::cout <<
"Mtx add using ASM - Time elapsed: "
75 << std::chrono::duration_cast<std::chrono::milliseconds>(
76 end_time - mtx_start_time)
78 <<
" ms" << std::endl;
void matrix_addition(float *A, float *B, float *C, int matrixSize)
void initialize_matrix_random(float *matrix, int matrixSize)
void print_matrix(const char *name, float *matrix, int matrixSize)