[cig-commits] [commit] devel, master: pass launch_bounds macros to OCL processor (32bcdea)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:15:54 PST 2014


Repository : https://github.com/geodynamics/specfem3d_globe

On branches: devel,master
Link       : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f

>---------------------------------------------------------------

commit 32bcdea605369bbcf3bdb7ffa2e61f0fd3779fdb
Author: Kevin Pouget <kevin.pouget at imag.fr>
Date:   Wed May 14 16:27:03 2014 +0200

    pass launch_bounds macros to OCL processor


>---------------------------------------------------------------

32bcdea605369bbcf3bdb7ffa2e61f0fd3779fdb
 src/gpu/initialize_gpu.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/gpu/initialize_gpu.c b/src/gpu/initialize_gpu.c
index 3cdc74a..13fd80f 100644
--- a/src/gpu/initialize_gpu.c
+++ b/src/gpu/initialize_gpu.c
@@ -42,7 +42,7 @@ static struct {
   const char *name;
   const char *value;
 } _macro_to_kernel[] = {
-    /* macro values */
+  /* macro values */
   PASS(NDIM),
   PASS(NGLLX), PASS(NGLL2), PASS(NGLL3), PASS(NGLL3_PADDED),
   PASS(N_SLS),
@@ -51,17 +51,21 @@ static struct {
   PASS(COLORING_MIN_NSPEC_OUTER_CORE), PASS(COLORING_MIN_NSPEC_INNER_CORE),
   PASS(R_EARTH_KM),
   
-  /* macro functions: not working yet because of spaces */
-  /*
-   PASS(INDEX2(xsize, x, y)),
+  /* macro functions: not working yet, spaces not allowed in OCL compiler*/
+  
+/* PASS(INDEX2(xsize, x, y)),
    PASS(INDEX3(xsize, ysize, x, y, z)),
    PASS(INDEX4(xsize, ysize, zsize, x, y, z, i)),
    PASS(INDEX4_PADDED(xsize, ysize, zsize, x, y, z, i)),
    PASS(INDEX5(xsize, ysize, zsize, isize, x, y, z, i, j)),
-   PASS(INDEX6(xsize, ysize, zsize, isize, jsize, x, y, z, i, j, k)),
-  */
-  /* macro flags, passed only ifdef */
+   PASS(INDEX6(xsize, ysize, zsize, isize, jsize, x, y, z, i, j, k)), */
+  
+  /* macro flags, passed only ifdefed */
   PASS(MANUALLY_UNROLLED_LOOPS), PASS(USE_TEXTURES_CONSTANTS), PASS(USE_TEXTURES_FIELDS),
+
+  PASS(USE_LAUNCH_BOUNDS),
+  PASS(LAUNCH_MIN_BLOCKS),
+  
   {NULL, NULL}
 };
 #endif
@@ -540,21 +544,21 @@ void ocl_select_device(const char *platform_filter, const char *device_filter, i
 
 static char *trim_and_default(char *s)
 {
-  //trim before
-  while(*s != '\0' && isspace(*s)) s++;
+  // trim before
+  while (*s != '\0' && isspace(*s)) s++;
 
   if (*s == '\0') {
     return s;
   }
-  //trim after
+  
+  // trim after
   char *back = s + strlen(s);
-  while(isspace(*--back));
-  *(back+1) = '\0';
+  while (isspace(*--back));
+  *(back + 1) = '\0';
 
+  // replace * by empty string
   if (strlen(s) == 1 && *s == '*') {
     *s = '\0';
-
-    return s;
   }
   
   return s;



More information about the CIG-COMMITS mailing list