@@ -29,6 +29,14 @@ struct S64 {
2929 Eigen::Matrix3d &x51, &x52, &x53, &x54, &x55, &x56, &x57, &x58, &x59, &x60, &x61, &x62, &x63;
3030};
3131
32+ struct Snbody {
33+ float &x, &y, &z, &vx, &vy, &vz;
34+ };
35+
36+ struct Sstencil {
37+ double &src, &dst, &rhs;
38+ };
39+
3240int main (int argc, char **argv)
3341{
3442 // Seperate loops to sort the output by benchmark.
@@ -57,14 +65,30 @@ int main(int argc, char **argv)
5765 benchmark::RegisterBenchmark (" BM_CPURealRW" , BM_CPURealRW<SoA>, t)->Arg (n)->Unit (benchmark::kMillisecond );
5866 }
5967
60- for (auto n : N) {
68+ for (auto n : N) {
6169 using SoA = rmpp::AoS2SoA<S64, 64 >;
6270 auto byte_size = SoA::ComputeSize (n);
6371 auto buffer = reinterpret_cast <std::byte *>(aligned_alloc (64 , byte_size));
6472 SoA t (buffer, byte_size, n);
6573 benchmark::RegisterBenchmark (" BM_CPUHardRW" , BM_CPUHardRW<SoA>, t)->Arg (n)->Unit (benchmark::kMillisecond );
6674 }
6775
76+ for (auto n : N) {
77+ using SoA = rmpp::AoS2SoA<Snbody, 64 >;
78+ auto byte_size = SoA::ComputeSize (n);
79+ auto buffer = reinterpret_cast <std::byte *>(aligned_alloc (64 , byte_size));
80+ SoA t (buffer, byte_size, n);
81+ benchmark::RegisterBenchmark (" BM_nbody" , BM_nbody<SoA>, t)->Arg (n)->Unit (benchmark::kMillisecond );
82+ }
83+
84+ for (auto n : N) {
85+ using SoA = rmpp::AoS2SoA<Sstencil, 64 >;
86+ auto byte_size = SoA::ComputeSize (n);
87+ auto buffer = reinterpret_cast <std::byte *>(aligned_alloc (64 , byte_size));
88+ SoA t (buffer, byte_size, n);
89+ benchmark::RegisterBenchmark (" BM_stencil" , BM_stencil<SoA>, t)->Arg (n)->Unit (benchmark::kMillisecond );
90+ }
91+
6892 benchmark::Initialize (&argc, argv);
6993 benchmark::RunSpecifiedBenchmarks ();
7094 benchmark::Shutdown ();
0 commit comments