10 std::cout <<
"3D Array with grid_key_d storing property: " <<
"\n";
16 clock_gettime(CLOCK_REALTIME, &ts_start);
18 for (
int i = 0 ; i < GS_SIZE ; i++)
20 for (
int j = 0 ; j < GS_SIZE ; j++)
22 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";
63 std::cout <<
"3D Array with grid_key_d storing property: " <<
"\n";
69 clock_gettime(CLOCK_REALTIME, &ts_start);
71 for (
int i = 0 ; i < GS_SIZE ; i++)
73 for (
int j = 0 ; j < GS_SIZE ; j++)
75 for (
int k = 0 ; k < GS_SIZE ; k++)
93 c3.get(kt)[0][0] = 1.0f;
94 c3.get(kt)[0][1] = 2.0f;
95 c3.get(kt)[0][2] = 3.0f;
96 c3.get(kt)[1][0] = 4.0f;
97 c3.get(kt)[1][1] = 5.0f;
98 c3.get(kt)[1][2] = 6.0f;
99 c3.get(kt)[2][0] = 7.0f;
100 c3.get(kt)[2][1] = 8.0f;
101 c3.get(kt)[2][2] = 9.0f;
107 clock_gettime(CLOCK_REALTIME, &end_time);
108 float time_dif =(float)( end_time.tv_sec - ts_start.tv_sec + (
double)(end_time.tv_nsec - ts_start.tv_nsec)/1000000000.0 );
110 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.
grid_key_d is the key to access any element in the grid
Test structure used for several test.