11 std::cout <<
"3D Array with grid_key_3 storing property: " <<
"\n";
17 clock_gettime(CLOCK_REALTIME, &ts_start);
20 for (
int i = 0 ; i < GS_SIZE ; i++)
22 for (
int j = 0 ; j < GS_SIZE ; j++)
24 for (
int k = 0 ; k < GS_SIZE ; k++)
26 grid_key_3<P::x> kx(i,j,k);
27 grid_key_3<P::y> ky(i,j,k);
28 grid_key_3<P::z> kz(i,j,k);
29 grid_key_3<P::s> ks(i,j,k);
30 grid_key_3<P::v> kv(i,j,k);
31 grid_key_3<P::t> kt(i,j,k);
42 c3.get(kt)[0][0] = 1.0f;
43 c3.get(kt)[0][1] = 2.0f;
44 c3.get(kt)[0][2] = 3.0f;
45 c3.get(kt)[1][0] = 4.0f;
46 c3.get(kt)[1][1] = 5.0f;
47 c3.get(kt)[1][2] = 6.0f;
48 c3.get(kt)[2][0] = 7.0f;
49 c3.get(kt)[2][1] = 8.0f;
50 c3.get(kt)[2][2] = 9.0f;
56 clock_gettime(CLOCK_REALTIME, &end_time);
57 float time_dif =(float)( end_time.tv_sec - ts_start.tv_sec + (
double)(end_time.tv_nsec - ts_start.tv_nsec)/1000000000.0 );
59 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";
66 std::cout <<
"3D Array with grid_key_3 storing property: " <<
"\n";
72 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++)
81 grid_key_3<P::x> kx(i,j,k);
82 grid_key_3<P::y> ky(i,j,k);
83 grid_key_3<P::z> kz(i,j,k);
84 grid_key_3<P::s> ks(i,j,k);
85 grid_key_3<P::v> kv(i,j,k);
86 grid_key_3<P::t> kt(i,j,k);
97 c3.get(kt)[0][0] = 1.0f;
98 c3.get(kt)[0][1] = 2.0f;
99 c3.get(kt)[0][2] = 3.0f;
100 c3.get(kt)[1][0] = 4.0f;
101 c3.get(kt)[1][1] = 5.0f;
102 c3.get(kt)[1][2] = 6.0f;
103 c3.get(kt)[2][0] = 7.0f;
104 c3.get(kt)[2][1] = 8.0f;
105 c3.get(kt)[2][2] = 9.0f;
111 clock_gettime(CLOCK_REALTIME, &end_time);
112 float time_dif =(float)( end_time.tv_sec - ts_start.tv_sec + (
double)(end_time.tv_nsec - ts_start.tv_nsec)/1000000000.0 );
114 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.
Test structure used for several test.