OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-CompactHash commits / 23a7fa4

Changing mesh generation threshold to float with a default of 1.0
23a7fa44759864214f04f36e7dc98b24a28d50a0
by brobey <brobey@lanl.gov> · 2016-01-20T22:29:33.000Z

Changed files (1) +7 -7

neigh2d.c +7 -7
……@@ -179,7 +179,7 @@ cl_kernel neighbors2d_hashwrite_kern, neighbors2d_hashwrite_opt_1_kern, neighbor
179179intintHash_Factory *factory;
180180intintHash_Factory *CLFactory;
181181
182void neighbors2d( uint mesh_size, int levmx, int threshold, int *options, int haveGPU);
182void neighbors2d( uint mesh_size, int levmx, float threshold, int *options, int haveGPU);
183183struct neighbor2d *neighbors2d_bruteforce( uint ncells, int *i, int *j, int *level );
184184struct neighbor2d *neighbors2d_kdtree( uint ncells, int mesh_size, double *x, double *y, int *level );
185185struct neighbor2d *neighbors2d_hashcpu( uint ncells, int mesh_size, int levmx, int *i, int *j, int *level );
……@@ -204,7 +204,7 @@ cl_mem neighbors2d_hashlibgpu_opt_3( uint ncells, int mesh_size, int levmx, cl_m
204204cl_mem neighbors2d_hashlibgpu_opt_4( uint ncells, int mesh_size, int levmx, cl_mem i, cl_mem j, cl_mem level, cl_mem levtable);
205205#endif
206206
207int adaptiveMeshConstructorWij(const int n, const int l, int** level_ptr, double** x_ptr, double** y_ptr, int **i_ptr, int **j_ptr, int threshold, int target_ncells);
207int adaptiveMeshConstructorWij(const int n, const int l, int** level_ptr, double** x_ptr, double** y_ptr, int **i_ptr, int **j_ptr, float threshold, int target_ncells);
208208void genmatrixfree(void **var);
209209void **genmatrix(int jnum, int inum, size_t elsize);
210210FILE * fmem;
……@@ -233,7 +233,7 @@ int main (int argc, const char * argv[])
233233 char add_string[40];
234234
235235 int *options;
236 int threshold = 20;
236 float threshold = 1.0;
237237
238238 uint levmx_min = 1;
239239 uint levmx_max = 6;
……@@ -258,7 +258,7 @@ int main (int argc, const char * argv[])
258258 }
259259 if (strcmp(argv[i], "-t") == 0) {
260260 i++;
261 threshold =(int)(atoi(argv[i]));
261 threshold =(atof(argv[i]));
262262 }
263263 if (strcmp(argv[i], "-l") == 0) {
264264 i++;
……@@ -381,7 +381,7 @@ int main (int argc, const char * argv[])
381381 printf("\n 2D Neighbors Performance Results\n\n");
382382 printf("%s\n",header);
383383
384 printf("\nThreshold for refinement is %d\n",threshold);
384 printf("\nThreshold for refinement is %f\n",threshold);
385385 printf("\nWork group size is %d and init workgroup size is %d\n",TILE_SIZE,TILE_SIZE_INIT);
386386 for (uint levmx = levmx_min; levmx < levmx_max; levmx++ ){
387387 printf("\nMax levels is %d\n",levmx);
……@@ -425,7 +425,7 @@ void neigh2dCLTester(int ncells, int *level, struct neighbor2d *neigh2d_gold, cl
425425}
426426#endif
427427
428void neighbors2d( uint mesh_size, int levmx, int threshold, int *options, int haveGPU)
428void neighbors2d( uint mesh_size, int levmx, float threshold, int *options, int haveGPU)
429429{
430430 struct neighbor2d *neigh2d_gold, *neigh2d_test;
431431
……@@ -2996,7 +2996,7 @@ cl_mem neighbors2d_hasholdlibgpu_opt_3( uint ncells, int mesh_size, int levmx, c
29962996// Output: number of cells in the adaptive mesh
29972997//
29982998int adaptiveMeshConstructorWij(const int n, const int levmax,
2999 int** level_ptr, double** x_ptr, double** y_ptr, int **i_ptr, int **j_ptr, int threshold, int target_ncells) {
2999 int** level_ptr, double** x_ptr, double** y_ptr, int **i_ptr, int **j_ptr, float threshold, int target_ncells) {
30003000 int ncells = SQ(n);
30013001
30023002 // ints used for for() loops later