MCPcopy Create free account
hub / github.com/TRIQS/triqs / ArrayFill

Function ArrayFill

benchmarks/GfFill.cpp:30–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28// ===== Fill Array Tensor
29
30static void ArrayFill(benchmark::State &state) {
31 std::size_t n_iw = state.range(0);
32 nda::array<scalar_t, 2> arr{4 * n_iw, 4 * n_iw};
33 nda::array<scalar_t, 3> tensor{2 * n_iw + 1, 2 * n_iw, 2 * n_iw};
34 for (auto _ : state) {
35 for (int q : range(-n_iw, n_iw + 1)) // Bosonic
36 for (int m : range(-n_iw, n_iw)) // Fermionic
37 for (int n : range(-n_iw, n_iw)) // Fermionic
38 tensor(q + n_iw, m + n_iw, n + n_iw) += arr(m + 2 * n_iw, q + m + 2 * n_iw) * arr(q + n + 2 * n_iw, n + 2 * n_iw);
39 }
40 state.SetBytesProcessed(int64_t(state.iterations()) * 8 * n_iw * n_iw * n_iw * sizeof(scalar_t));
41}
42BENCHMARK(ArrayFill)->RangeMultiplier(2)->Range(1 << 6, 1 << 8); //->Complexity();
43
44// ===== Fill Green function Tensor Loop

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected