10 std::cout <<
"3D Array with grid_key runtime dimensions " <<
"\n";
12 grid_key<Point<float>::x> kx(3);
13 grid_key<Point<float>::y> ky(kx);
14 grid_key<Point<float>::z> kz(kx);
15 grid_key<Point<float>::s> ks(kx);
16 grid_key<Point<float>::v> kv(kx);
17 grid_key<Point<float>::t> kt(kx);
21 clock_gettime(CLOCK_REALTIME, &ts_start);
23 for (
int i = 0 ; i < GS_SIZE ; i++)
25 for (
int j = 0 ; j < GS_SIZE ; j++)
27 for (
int k = 0 ; k < GS_SIZE ; k++)
40 c3.get(kt)[0][0] = 1.0f;
41 c3.get(kt)[0][1] = 2.0f;
42 c3.get(kt)[0][2] = 3.0f;
43 c3.get(kt)[1][0] = 4.0f;
44 c3.get(kt)[1][1] = 5.0f;
45 c3.get(kt)[1][2] = 6.0f;
46 c3.get(kt)[2][0] = 7.0f;
47 c3.get(kt)[2][1] = 8.0f;
48 c3.get(kt)[2][2] = 9.0f;
54 clock_gettime(CLOCK_REALTIME, &end_time);
55 float time_dif =(float)( end_time.tv_sec - ts_start.tv_sec + (
double)(end_time.tv_nsec - ts_start.tv_nsec)/1000000000.0 );
57 std::cout <<
"End : " << GS_SIZE*GS_SIZE*GS_SIZE*16*4/1024/1024 <<
" MB " <<
" Bandwidth: " << GS_SIZE*GS_SIZE*GS_SIZE*16*4/1024/1024/time_dif <<
" MB/s \n";
62 std::cout <<
"3D Array with grid_key runtime dimensions " <<
"\n";
64 grid_key<Point<float>::x> kx(3);
65 grid_key<Point<float>::y> ky(kx);
66 grid_key<Point<float>::z> kz(kx);
67 grid_key<Point<float>::s> ks(kx);
68 grid_key<Point<float>::v> kv(kx);
69 grid_key<Point<float>::t> kt(kx);
73 clock_gettime(CLOCK_REALTIME, &ts_start);
75 for (
int i = 0 ; i < GS_SIZE ; i++)
77 for (
int j = 0 ; j < GS_SIZE ; j++)
79 for (
int k = 0 ; k < GS_SIZE ; k++)
92 c3.get(kt)[0][0] = 1.0f;
93 c3.get(kt)[0][1] = 2.0f;
94 c3.get(kt)[0][2] = 3.0f;
95 c3.get(kt)[1][0] = 4.0f;
96 c3.get(kt)[1][1] = 5.0f;
97 c3.get(kt)[1][2] = 6.0f;
98 c3.get(kt)[2][0] = 7.0f;
99 c3.get(kt)[2][1] = 8.0f;
100 c3.get(kt)[2][2] = 9.0f;
106 clock_gettime(CLOCK_REALTIME, &end_time);
107 float time_dif =(float)( end_time.tv_sec - ts_start.tv_sec + (
double)(end_time.tv_nsec - ts_start.tv_nsec)/1000000000.0 );
109 std::cout <<
"End : " << GS_SIZE*GS_SIZE*GS_SIZE*16*4/1024/1024 <<
" MB " <<
" Bandwidth: " << GS_SIZE*GS_SIZE*GS_SIZE*16*4/1024/1024/time_dif <<
" MB/s \n";
This class implement the point shape in an N-dimensional space.