From b507fe209c18d3ac8885587fe7b3bbf93ca8cd30 Mon Sep 17 00:00:00 2001 From: Dennis Bollweg Date: Tue, 27 Feb 2024 11:28:32 -0500 Subject: [PATCH] Added SpinColourMatrix case to sliceSum Test --- tests/core/Test_sliceSum.cc | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/core/Test_sliceSum.cc b/tests/core/Test_sliceSum.cc index 5275ddc2..e366f1f3 100644 --- a/tests/core/Test_sliceSum.cc +++ b/tests/core/Test_sliceSum.cc @@ -257,7 +257,65 @@ int main (int argc, char ** argv) { } traceStop(trace_id); + LatticeSpinColourMatrixD test_data_scm(&Grid); + gaussian(pRNG,test_data_scm); + + std::vector reduction_reference_scm; + std::vector reduction_result_scm; + + //warmup + for (int sweeps = 0; sweeps < 5; sweeps++) { + reduction_result_scm = sliceSum(test_data_scm,0); + } + trace_id = traceStart("sliceSum benchmark - SpinColourMatrixD"); + + std::cout << GridLogMessage << "Testing SpinColourMatrixD" << std::endl; + std::cout << GridLogMessage << "sizeof(SpinColourMatrixD) = " << sizeof(SpinColourMatrixD) << std::endl; + std::cout << GridLogMessage << "sizeof(vSpinColourMatrixD) = " << sizeof(vSpinColourMatrixD) << std::endl; + for (int i = 0; i < Nd; i++) { + + RealD t=-usecond(); + + tracePush("sliceSum"); + sliceSumCPU(test_data_scm,reduction_reference_scm,i); + tracePop("sliceSum"); + + t+=usecond(); + std::cout << GridLogMessage << "Orthog. dir. = " << i << std::endl; + std::cout << GridLogMessage << "CPU sliceSum took "<