Skip to content
Snippets Groups Projects
Commit 88cf7c69 authored by Mattia Mancini's avatar Mattia Mancini
Browse files

Fix memory test

parent ac6244c0
No related branches found
No related tags found
No related merge requests found
Pipeline #106597 passed with warnings
......@@ -5,6 +5,7 @@
#include <memory>
constexpr size_t MB = 1024 * 1024;
namespace {
class InitializeInput : public benchmark::Fixture {
public:
void SetUp(::benchmark::State& state) {
......@@ -31,6 +32,7 @@ class InitializeInput : public benchmark::Fixture {
float* B;
size_t array_size;
};
} // namespace
BENCHMARK_F(InitializeInput, MemoryAccessRandomAccessData)
(benchmark::State& state) {
......
#include <benchmark/benchmark.h>
#include <matrix_multiplication.h>
namespace {
class InitializeInput : public benchmark::Fixture {
public:
void SetUp(::benchmark::State& state) {
......@@ -25,6 +26,7 @@ class InitializeInput : public benchmark::Fixture {
std::complex<float>* B;
std::complex<float>* C;
};
} // namespace
// Reference standard
BENCHMARK_F(InitializeInput, MatrixMultiplicationReference)
......
......@@ -6,8 +6,9 @@
inline void Initialize(float* a, size_t size) {
// Initialize matrices with random complex values
std::random_device rd;
std::mt19937 gen(rd());
std::seed_seq seed({42});
std::mt19937 gen(seed);
std::uniform_real_distribution<float> dis(-1.0, 1.0);
for (size_t i = 0; i < size; i++) {
a[i] = dis(gen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment