From 86eac788adb9de7f345b444504712f1fdc29c050 Mon Sep 17 00:00:00 2001 From: Incardona Pietro <incardon@mpi-cbg.de> Date: Wed, 15 Dec 2021 19:13:30 +0100 Subject: [PATCH] Fixing const auto --- example/Performance/memBW/main.cu | 19 +++++++++++-------- openfpm_data | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/example/Performance/memBW/main.cu b/example/Performance/memBW/main.cu index 4541cbb48..94d8af3c8 100644 --- a/example/Performance/memBW/main.cu +++ b/example/Performance/memBW/main.cu @@ -9,15 +9,18 @@ inline __global__ void translate_fill_prop(vector_type vd_out, vector_type2 vd_i { auto p = blockIdx.x * blockDim.x + threadIdx.x; - vd_out.template get<0>(p) = vd_in.template get<0>(p)[0] + vd_in.template get<0>(p)[1]; + float a = vd_in.template get<0>(p)[0]; + float b = vd_in.template get<0>(p)[1]; - vd_out.template get<1>(p)[0] = vd_in.template get<0>(p)[0]; - vd_out.template get<1>(p)[1] = vd_in.template get<0>(p)[1]; + vd_out.template get<0>(p) = a + b; - vd_out.template get<2>(p)[0][0] = vd_in.template get<0>(p)[0]; - vd_out.template get<2>(p)[0][1] = vd_in.template get<0>(p)[1]; - vd_out.template get<2>(p)[1][0] = vd_in.template get<0>(p)[0] + vd_in.template get<0>(p)[1]; - vd_out.template get<2>(p)[1][1] = vd_in.template get<0>(p)[1] - vd_in.template get<0>(p)[0]; + vd_out.template get<1>(p)[0] = a; + vd_out.template get<1>(p)[1] = b; + + vd_out.template get<2>(p)[0][0] = a; + vd_out.template get<2>(p)[0][1] = b; + vd_out.template get<2>(p)[1][0] = a + b; + vd_out.template get<2>(p)[1][1] = b - a; vd_in.template get<0>(p)[0] += 0.01f; vd_in.template get<0>(p)[1] += 0.01f; @@ -57,7 +60,7 @@ int main(int argc, char *argv[]) t.stop(); std::cout << "Time: " << t.getwct() << std::endl; - std::cout << "BW: " << nele*4*19 / t.getwct() * 1e-9 << " GB/s" << std::endl; + std::cout << "BW: " << nele*4*11 / t.getwct() * 1e-9 << " GB/s" << std::endl; } } diff --git a/openfpm_data b/openfpm_data index 1d3887432..0cef3b814 160000 --- a/openfpm_data +++ b/openfpm_data @@ -1 +1 @@ -Subproject commit 1d388743232b43ff75f539492f62d5b8eeb8f7e9 +Subproject commit 0cef3b814a89f3a5ae18c3582468f2bbd5b230c9 -- GitLab