[cig-commits] [commit] devel, master: Removed direct usage of BOAST state (06d6397)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:30:34 PST 2014


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

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

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

commit 06d63973e9c998ef52042a177386565f10cbc854
Author: Brice Videau <videau at pilipili2.imag.fr>
Date:   Wed Sep 10 15:44:16 2014 +0200

    Removed direct usage of BOAST state


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

06d63973e9c998ef52042a177386565f10cbc854
 src/gpu/boast/assemble_boundary_accel_on_device.rb |  2 +-
 src/gpu/boast/compute_acoustic_kernel.rb           |  2 +-
 .../boast/compute_add_sources_adjoint_kernel.rb    |  2 +-
 src/gpu/boast/compute_add_sources_kernel.rb        |  2 +-
 src/gpu/boast/compute_ani_kernel.rb                |  2 +-
 src/gpu/boast/compute_ani_undo_att_kernel.rb       |  2 +-
 src/gpu/boast/compute_coupling_fluid_CMB_kernel.rb |  2 +-
 src/gpu/boast/compute_coupling_ocean_kernel.rb     |  2 +-
 src/gpu/boast/compute_hess_kernel.rb               |  2 +-
 src/gpu/boast/compute_iso_kernel.rb                |  2 +-
 src/gpu/boast/compute_rho_kernel.rb                |  2 +-
 src/gpu/boast/compute_stacey_acoustic_kernel.rb    |  2 +-
 src/gpu/boast/compute_stacey_elastic_kernel.rb     |  2 +-
 src/gpu/boast/compute_strain_kernel.rb             |  2 +-
 src/gpu/boast/compute_strength_noise_kernel.rb     |  2 +-
 src/gpu/boast/get_maximum_scalar_kernel.rb         |  2 +-
 src/gpu/boast/inner_core_impl_kernel_forward.rb    | 82 +++++++++++-----------
 .../boast/noise_add_source_master_rec_kernel.rb    |  2 +-
 src/gpu/boast/noise_add_surface_movie_kernel.rb    |  2 +-
 .../boast/noise_transfer_surface_to_host_kernel.rb |  2 +-
 src/gpu/boast/outer_core_impl_kernel_forward.rb    | 76 ++++++++++----------
 src/gpu/boast/prepare_boundary_accel_on_device.rb  |  2 +-
 src/gpu/boast/update_disp_veloc_kernel.rb          |  2 +-
 ...rite_seismograms_transfer_from_device_kernel.rb |  2 +-
 24 files changed, 101 insertions(+), 101 deletions(-)

diff --git a/src/gpu/boast/assemble_boundary_accel_on_device.rb b/src/gpu/boast/assemble_boundary_accel_on_device.rb
index 09bbf77..a2ea858 100644
--- a/src/gpu/boast/assemble_boundary_accel_on_device.rb
+++ b/src/gpu/boast/assemble_boundary_accel_on_device.rb
@@ -30,7 +30,7 @@ module BOAST
     
     p = Procedure(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header
       open p
diff --git a/src/gpu/boast/compute_acoustic_kernel.rb b/src/gpu/boast/compute_acoustic_kernel.rb
index af4637c..9c16cd3 100644
--- a/src/gpu/boast/compute_acoustic_kernel.rb
+++ b/src/gpu/boast/compute_acoustic_kernel.rb
@@ -89,7 +89,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngllx => n_gllx, :ngll2 => n_gll2, :ngll3 => n_gll3, :ngll3_padded => n_gll3_padded )
       sub_compute_gradient_kernel = compute_gradient_kernel(n_gllx, n_gll2, n_gll3, n_gll3_padded)
diff --git a/src/gpu/boast/compute_add_sources_adjoint_kernel.rb b/src/gpu/boast/compute_add_sources_adjoint_kernel.rb
index f5979da..4e6c1fb 100644
--- a/src/gpu/boast/compute_add_sources_adjoint_kernel.rb
+++ b/src/gpu/boast/compute_add_sources_adjoint_kernel.rb
@@ -15,7 +15,7 @@ module BOAST
     ngllx =              Int( "NGLLX",             :const => n_gllx)
     p = Procedure(function_name, [accel,nrec,adj_sourcearrays,ibool,ispec_selected_rec,pre_computed_irec,nadj_rec_local])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CUDA or get_lang == CL) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx )
       open p
diff --git a/src/gpu/boast/compute_add_sources_kernel.rb b/src/gpu/boast/compute_add_sources_kernel.rb
index af70197..e2e2c58 100644
--- a/src/gpu/boast/compute_add_sources_kernel.rb
+++ b/src/gpu/boast/compute_add_sources_kernel.rb
@@ -16,7 +16,7 @@ module BOAST
     ngllx =                  Int("NGLLX",                 :const => n_gllx)
     p = Procedure(function_name, [accel,ibool,sourcearrays,stf_pre_compute,myrank,islice_selected_source,ispec_selected_source,nsources])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CUDA or get_lang == CL) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx, :double => true )
       open p
diff --git a/src/gpu/boast/compute_ani_kernel.rb b/src/gpu/boast/compute_ani_kernel.rb
index 24db295..a2de56a 100644
--- a/src/gpu/boast/compute_ani_kernel.rb
+++ b/src/gpu/boast/compute_ani_kernel.rb
@@ -30,7 +30,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngll3 => n_gll3 )
       sub_compute_strain_product =  compute_strain_product()
diff --git a/src/gpu/boast/compute_ani_undo_att_kernel.rb b/src/gpu/boast/compute_ani_undo_att_kernel.rb
index d72d7c7..d22ca36 100644
--- a/src/gpu/boast/compute_ani_undo_att_kernel.rb
+++ b/src/gpu/boast/compute_ani_undo_att_kernel.rb
@@ -48,7 +48,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngllx => n_gllx, :ngll2 => n_gll2, :ngll3 => n_gll3, :ngll3_padded => n_gll3_padded )
       sub_compute_element_strain_undo_att = compute_element_strain_undo_att(n_gllx, n_gll2, n_gll3, n_gll3_padded )
diff --git a/src/gpu/boast/compute_coupling_fluid_CMB_kernel.rb b/src/gpu/boast/compute_coupling_fluid_CMB_kernel.rb
index 6c6a72d..a51811a 100644
--- a/src/gpu/boast/compute_coupling_fluid_CMB_kernel.rb
+++ b/src/gpu/boast/compute_coupling_fluid_CMB_kernel.rb
@@ -72,7 +72,7 @@ module BOAST
     end
     p = Procedure(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx )
       open p
diff --git a/src/gpu/boast/compute_coupling_ocean_kernel.rb b/src/gpu/boast/compute_coupling_ocean_kernel.rb
index 102eeef..17e072e 100644
--- a/src/gpu/boast/compute_coupling_ocean_kernel.rb
+++ b/src/gpu/boast/compute_coupling_ocean_kernel.rb
@@ -17,7 +17,7 @@ module BOAST
 
     p = Procedure(function_name, [accel_crust_mantle, rmassx_crust_mantle, rmassy_crust_mantle, rmassz_crust_mantle, rmass_ocean_load, npoin_ocean_load, ibool_ocean_load, normal_ocean_load])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim )
       open p
diff --git a/src/gpu/boast/compute_hess_kernel.rb b/src/gpu/boast/compute_hess_kernel.rb
index d62e8b7..dec7da9 100644
--- a/src/gpu/boast/compute_hess_kernel.rb
+++ b/src/gpu/boast/compute_hess_kernel.rb
@@ -16,7 +16,7 @@ module BOAST
 
     p = Procedure(function_name, [ibool, accel, b_accel, hess_kl, deltat, nspec_ab])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngll3 => n_gll3 )
       open p
diff --git a/src/gpu/boast/compute_iso_kernel.rb b/src/gpu/boast/compute_iso_kernel.rb
index 7a18d22..aba8944 100644
--- a/src/gpu/boast/compute_iso_kernel.rb
+++ b/src/gpu/boast/compute_iso_kernel.rb
@@ -27,7 +27,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngll3 => n_gll3 )
       open p
diff --git a/src/gpu/boast/compute_rho_kernel.rb b/src/gpu/boast/compute_rho_kernel.rb
index 853f926..e551228 100644
--- a/src/gpu/boast/compute_rho_kernel.rb
+++ b/src/gpu/boast/compute_rho_kernel.rb
@@ -16,7 +16,7 @@ module BOAST
 
     p = Procedure(function_name, [ibool, accel, b_displ, rho_kl, nspec, deltat])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngll3 => n_gll3 )
       open p
diff --git a/src/gpu/boast/compute_stacey_acoustic_kernel.rb b/src/gpu/boast/compute_stacey_acoustic_kernel.rb
index 3ed9a6d..e5f78fa 100644
--- a/src/gpu/boast/compute_stacey_acoustic_kernel.rb
+++ b/src/gpu/boast/compute_stacey_acoustic_kernel.rb
@@ -49,7 +49,7 @@ module BOAST
 
     p = Procedure(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngllx => n_gllx, :ngll2 => n_gll2 )
       open p
diff --git a/src/gpu/boast/compute_stacey_elastic_kernel.rb b/src/gpu/boast/compute_stacey_elastic_kernel.rb
index f7de59c..97f5c25 100644
--- a/src/gpu/boast/compute_stacey_elastic_kernel.rb
+++ b/src/gpu/boast/compute_stacey_elastic_kernel.rb
@@ -52,7 +52,7 @@ module BOAST
 
     p = Procedure(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx, :ngll2 => n_gll2 )
       open p
diff --git a/src/gpu/boast/compute_strain_kernel.rb b/src/gpu/boast/compute_strain_kernel.rb
index 6991f2a..dc4ec21 100644
--- a/src/gpu/boast/compute_strain_kernel.rb
+++ b/src/gpu/boast/compute_strain_kernel.rb
@@ -33,7 +33,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif (get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngllx => n_gllx, :ngll2 => n_gll2, :ngll3 => n_gll3, :ngll3_padded => n_gll3_padded )
 
diff --git a/src/gpu/boast/compute_strength_noise_kernel.rb b/src/gpu/boast/compute_strength_noise_kernel.rb
index be81394..63a513b 100644
--- a/src/gpu/boast/compute_strength_noise_kernel.rb
+++ b/src/gpu/boast/compute_strength_noise_kernel.rb
@@ -23,7 +23,7 @@ module BOAST
 
     p = Procedure(function_name, v)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx, :ngll2 => n_gll2 )
       open p
diff --git a/src/gpu/boast/get_maximum_scalar_kernel.rb b/src/gpu/boast/get_maximum_scalar_kernel.rb
index 38eb9a2..f612c45 100644
--- a/src/gpu/boast/get_maximum_scalar_kernel.rb
+++ b/src/gpu/boast/get_maximum_scalar_kernel.rb
@@ -22,7 +22,7 @@ module BOAST
     blocksize_transfer = Int("BLOCKSIZE_TRANSFER", :const => block_size_transfer)
     p = Procedure(function_name, [array, size, d_max])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CUDA or get_lang == CL) then
       make_specfem3d_header( :blocksize_transfer => block_size_transfer )
       open p
diff --git a/src/gpu/boast/inner_core_impl_kernel_forward.rb b/src/gpu/boast/inner_core_impl_kernel_forward.rb
index 41400be..62e2ef7 100644
--- a/src/gpu/boast/inner_core_impl_kernel_forward.rb
+++ b/src/gpu/boast/inner_core_impl_kernel_forward.rb
@@ -558,24 +558,24 @@ module BOAST
 
     p = Procedure(function_name, v, constants, :qualifiers => qualifiers)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu".gsub("_forward","").gsub("_adjoint",""))
+      get_output.print File::read("references/#{function_name}.cu".gsub("_forward","").gsub("_adjoint",""))
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header(:ngllx => n_gllx, :ngll2 => n_gll2, :ngll3 => n_gll3, :ngll3_padded => n_gll3_padded, :n_sls => n_sls, :r_earth_km => r_earth_km, :coloring_min_nspec_inner_core => coloring_min_nspec_inner_core, :iflag_in_fictitious_cube => i_flag_in_fictitious_cube)
       if type == :inner_core then
         #DEACTIVATE USE TEXTURES CONSTANTS
-        @@output.puts "#ifdef #{use_textures_constants}"
-        @@output.puts "#undef #{use_textures_constants}"
-        @@output.puts "#endif"
+        get_output.puts "#ifdef #{use_textures_constants}"
+        get_output.puts "#undef #{use_textures_constants}"
+        get_output.puts "#endif"
       end
 #      if get_lang == CUDA then
-#        @@output.puts "#ifdef #{use_textures_fields}"
+#        get_output.puts "#ifdef #{use_textures_fields}"
 #          decl d_displ_tex
 #          decl d_accel_tex
-#        @@output.puts "#endif"
-#        @@output.puts "#ifdef #{use_textures_constants}"
+#        get_output.puts "#endif"
+#        get_output.puts "#ifdef #{use_textures_constants}"
 #          decl d_hprime_xx_tex
 #          decl d_hprimewgll_xx_tex
-#        @@output.puts "#endif"
+#        get_output.puts "#endif"
 #      end
       if type == :inner_core then
         sub_compute_element_att_stress =  compute_element_ic_att_stress(n_gll3, n_sls)
@@ -599,20 +599,20 @@ module BOAST
       end
       open p
         if get_lang == CL then
-          @@output.puts "#ifdef #{use_textures_fields}"
+          get_output.puts "#ifdef #{use_textures_fields}"
             decl d_displ_tex.sampler
             decl d_accel_tex.sampler
-          @@output.puts "#endif"
-          @@output.puts "#ifdef #{use_textures_constants}"
+          get_output.puts "#endif"
+          get_output.puts "#ifdef #{use_textures_constants}"
             decl d_hprime_xx_tex.sampler
-          @@output.puts "#endif"
+          get_output.puts "#endif"
         end
         decl bx = Int("bx")
         decl tx = Int("tx")
         decl k  = Int("K"), j = Int("J"), i = Int("I")
-        @@output.puts "#ifndef #{manually_unrolled_loops}"
+        get_output.puts "#ifndef #{manually_unrolled_loops}"
           decl l = Int("l")
-        @@output.puts "#endif"
+        get_output.puts "#endif"
         decl active = Int("active", :size => 2, :signed => false)
         decl offset = Int("offset"), iglob = Int("iglob")
         decl working_element = Int("working_element")
@@ -701,27 +701,27 @@ module BOAST
   
         print active === Ternary( Expression("&&", tx < ngll3, bx < nb_blocks_to_compute), 1, 0)
         print If(active) {
-          @@output.puts "#ifdef #{use_mesh_coloring}"
+          get_output.puts "#ifdef #{use_mesh_coloring}"
             print working_element === bx
-          @@output.puts "#else"
+          get_output.puts "#else"
             print If(use_mesh_coloring_gpu, lambda {
               print working_element === bx
             }, lambda {
               print working_element === d_phase_ispec_inner[bx + num_phase_ispec*(d_iphase-1)]-1
             })
-          @@output.puts "#endif"
+          get_output.puts "#endif"
           __texture_fetch = lambda {
             print iglob === d_ibool[working_element*ngll3 + tx]-1
 
-            @@output.puts "#ifdef #{use_textures_fields}"
+            get_output.puts "#ifdef #{use_textures_fields}"
               (0..2).each { |indx|
                 print s_dummy_loc[indx][tx] === d_displ_tex[iglob*3+indx]
               }
-            @@output.puts "#else"
+            get_output.puts "#else"
               (0..2).each { |indx|
                 print s_dummy_loc[indx][tx] === d_displ[indx, iglob]
               }
-            @@output.puts "#endif"
+            get_output.puts "#endif"
           }
           if type == :inner_core then
             print If(d_idoubling[working_element] == iflag_in_fictitious_cube, lambda {
@@ -733,13 +733,13 @@ module BOAST
         }
         #inner core and crust mantle differ here, but crust mantle implementation though more reccent seems odd...
         print If(tx < ngll2) {
-          @@output.puts "#ifdef #{use_textures_constants}"
+          get_output.puts "#ifdef #{use_textures_constants}"
             print sh_hprime_xx[tx] === d_hprime_xx_tex[tx]
             print sh_hprimewgll_xx[tx] === d_hprimewgll_xx_tex[tx]
-          @@output.puts "#else"
+          get_output.puts "#else"
             print sh_hprime_xx[tx] === d_hprime_xx[tx]
             print sh_hprimewgll_xx[tx] === d_hprimewgll_xx[tx]
-          @@output.puts "#endif"
+          get_output.puts "#endif"
         }
         print barrier(:local)
   
@@ -766,11 +766,11 @@ module BOAST
               print tempanl[indx1][2] === tempanl[indx1][2] + s_dummy_loc[indx1][l*ngll2 + j*ngllx + i]*fac[2]
             }
           }
-          @@output.puts "#ifdef #{manually_unrolled_loops}"
+          get_output.puts "#ifdef #{manually_unrolled_loops}"
             for_loop.unroll
-          @@output.puts "#else"
+          get_output.puts "#else"
             print for_loop
-          @@output.puts "#endif"
+          get_output.puts "#endif"
 
           print offset === working_element*ngll3_padded + tx
           (0..2).each { |indx|
@@ -954,11 +954,11 @@ module BOAST
               print tempanl[indx1][2] === tempanl[indx1][2] + s_temp[indx1][2][offset]*fac[2]
             }
           }
-          @@output.puts "#ifdef #{manually_unrolled_loops}"
+          get_output.puts "#ifdef #{manually_unrolled_loops}"
             for_loop.unroll
-          @@output.puts "#else"
+          get_output.puts "#else"
             print for_loop
-          @@output.puts "#endif"
+          get_output.puts "#endif"
           print fac[0] === d_wgllwgll_yz[k*ngllx+j]
           print fac[1] === d_wgllwgll_xz[k*ngllx+i]
           print fac[2] === d_wgllwgll_xy[j*ngllx+i]
@@ -971,29 +971,29 @@ module BOAST
               print sum_terms[indx] === sum_terms[indx] + rho_s_H[indx]
             }
           }
-          @@output.puts "#ifdef #{use_mesh_coloring}"
-            @@output.puts "#ifdef #{use_textures_fields}"
+          get_output.puts "#ifdef #{use_mesh_coloring}"
+            get_output.puts "#ifdef #{use_textures_fields}"
               (0..2).each { |indx|
                 print d_accel[indx,iglob] === d_accel_tex[iglob*3+indx] + sum_terms[indx]
               }
-            @@output.puts "#else"
+            get_output.puts "#else"
               (0..2).each { |indx|
                 print d_accel[indx,iglob] === d_accel[indx,iglob] + sum_terms[indx]
               }
-            @@output.puts "#endif"
-          @@output.puts "#else"
+            get_output.puts "#endif"
+          get_output.puts "#else"
             if type == :inner_core then
               __accel_update = lambda {
                 print If(nspec_inner_core > coloring_min_nspec_inner_core, lambda {
-                  @@output.puts "#ifdef #{use_textures_fields}"
+                  get_output.puts "#ifdef #{use_textures_fields}"
                     (0..2).each { |indx|
                       print d_accel[indx,iglob] === d_accel_tex[iglob*3+indx] + sum_terms[indx]
                     }
-                  @@output.puts "#else"
+                  get_output.puts "#else"
                     (0..2).each { |indx|
                       print d_accel[indx,iglob] === d_accel[indx,iglob] + sum_terms[indx]
                     }
-                  @@output.puts "#endif"
+                  get_output.puts "#endif"
                 }, lambda{
                   (0..2).each { |indx|
                     print atomicAdd(d_accel+ iglob*3 +indx, sum_terms[indx])
@@ -1002,15 +1002,15 @@ module BOAST
               }
             elsif type == :crust_mantle then
               __accel_update = lambda {
-                @@output.puts "#ifdef #{use_textures_fields}"
+                get_output.puts "#ifdef #{use_textures_fields}"
                   (0..2).each { |indx|
                     print d_accel[indx,iglob] === d_accel_tex[iglob*3+indx] + sum_terms[indx]
                   }
-                @@output.puts "#else"
+                get_output.puts "#else"
                   (0..2).each { |indx|
                     print d_accel[indx,iglob] === d_accel[indx,iglob] + sum_terms[indx]
                   }
-                @@output.puts "#endif"
+                get_output.puts "#endif"
               }
             end
             print If(use_mesh_coloring_gpu, __accel_update, lambda {
@@ -1018,7 +1018,7 @@ module BOAST
                 print atomicAdd(d_accel + iglob*3 + indx, sum_terms[indx])
               }
             })
-          @@output.puts "#endif"
+          get_output.puts "#endif"
           print If(Expression("&&", attenuation, !partial_phys_dispersion_only ) ) {
             __params = [tx, working_element,\
                         d_muvstore, factor_common,\
diff --git a/src/gpu/boast/noise_add_source_master_rec_kernel.rb b/src/gpu/boast/noise_add_source_master_rec_kernel.rb
index 1080c47..8abe8c4 100644
--- a/src/gpu/boast/noise_add_source_master_rec_kernel.rb
+++ b/src/gpu/boast/noise_add_source_master_rec_kernel.rb
@@ -17,7 +17,7 @@ module BOAST
 
     p = Procedure(function_name, [ibool, ispec_selected_rec, irec_master_noise, accel, noise_sourcearray, it])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header(:ngll3 => n_gll3)
       open p
diff --git a/src/gpu/boast/noise_add_surface_movie_kernel.rb b/src/gpu/boast/noise_add_surface_movie_kernel.rb
index ee47025..13b643c 100644
--- a/src/gpu/boast/noise_add_surface_movie_kernel.rb
+++ b/src/gpu/boast/noise_add_surface_movie_kernel.rb
@@ -26,7 +26,7 @@ module BOAST
 
     p = Procedure(function_name, [accel,ibool,ibelm_top,nspec_top,noise_surface_movie,normal_x_noise,normal_y_noise,normal_z_noise,mask_noise,jacobian2D,wgllwgll])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx, :ngll2 => n_gll2)
       open p
diff --git a/src/gpu/boast/noise_transfer_surface_to_host_kernel.rb b/src/gpu/boast/noise_transfer_surface_to_host_kernel.rb
index f9b0bde..7ef2898 100644
--- a/src/gpu/boast/noise_transfer_surface_to_host_kernel.rb
+++ b/src/gpu/boast/noise_transfer_surface_to_host_kernel.rb
@@ -18,7 +18,7 @@ module BOAST
 
     p = Procedure(function_name, [ibelm_top,nspec_top,ibool,displ,noise_surface_movie])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ndim => n_dim, :ngllx => n_gllx, :ngll2 => n_gll2)
       open p
diff --git a/src/gpu/boast/outer_core_impl_kernel_forward.rb b/src/gpu/boast/outer_core_impl_kernel_forward.rb
index fbb1bb1..f278be7 100644
--- a/src/gpu/boast/outer_core_impl_kernel_forward.rb
+++ b/src/gpu/boast/outer_core_impl_kernel_forward.rb
@@ -123,42 +123,42 @@ module BOAST
 
     p = Procedure(function_name, v, constants)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu".gsub("_forward","").gsub("_adjoint",""))
+      get_output.print File::read("references/#{function_name}.cu".gsub("_forward","").gsub("_adjoint",""))
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header(:ngllx => n_gllx, :ngll2 => n_gll2, :ngll3 => n_gll3, :ngll3_padded => n_gll3_padded, :r_earth_km => r_earth_km, :coloring_min_nspec_outer_core => coloring_min_nspec_outer_core)
       #DEACTIVATE USE TEXTURES CONSTANTS
-      @@output.puts "#ifdef #{use_textures_constants}"
-      @@output.puts "#undef #{use_textures_constants}"
-      @@output.puts "#endif"
+      get_output.puts "#ifdef #{use_textures_constants}"
+      get_output.puts "#undef #{use_textures_constants}"
+      get_output.puts "#endif"
 
 #      if get_lang == CUDA
-#        @@output.puts "#ifdef #{use_textures_fields}"
+#        get_output.puts "#ifdef #{use_textures_fields}"
 #          decl d_displ_oc_tex
 #          decl d_accel_oc_tex
-#        @@output.puts "#endif"
-#        @@output.puts "#ifdef #{use_textures_constants}"
+#        get_output.puts "#endif"
+#        get_output.puts "#ifdef #{use_textures_constants}"
 #          decl d_hprime_xx_oc_tex
-#        @@output.puts "#endif"
+#        get_output.puts "#endif"
 #      end
       sub_kernel =  compute_element_oc_rotation(n_gll3)
       print sub_kernel
       open p
         if get_lang == CL then
-          @@output.puts "#ifdef #{use_textures_fields}"
+          get_output.puts "#ifdef #{use_textures_fields}"
             decl d_displ_oc_tex.sampler
             decl d_accel_oc_tex.sampler
-          @@output.puts "#endif"
-          @@output.puts "#ifdef #{use_textures_constants}"
+          get_output.puts "#endif"
+          get_output.puts "#ifdef #{use_textures_constants}"
             decl d_hprime_xx_oc_tex.sampler
             decl d_hprimewgll_xx_oc_tex.sampler
-          @@output.puts "#endif"
+          get_output.puts "#endif"
         end
         decl bx = Int("bx")
         decl tx = Int("tx")
         decl k  = Int("K"), j = Int("J"), i = Int("I")
-        @@output.puts "#ifndef #{manually_unrolled_loops}"
+        get_output.puts "#ifndef #{manually_unrolled_loops}"
           decl l = Int("l")
-        @@output.puts "#endif"
+        get_output.puts "#endif"
         decl active = Int("active", :size => 2, :signed => false)
         decl offset = Int("offset"), iglob = Int("iglob")
         decl working_element = Int("working_element")
@@ -199,32 +199,32 @@ module BOAST
   
         print active === Ternary( Expression("&&", tx < ngll3, bx < nb_blocks_to_compute), 1, 0)
         print If(active) {
-          @@output.puts "#ifdef #{use_mesh_coloring}"
+          get_output.puts "#ifdef #{use_mesh_coloring}"
             print working_element === bx
-          @@output.puts "#else"
+          get_output.puts "#else"
             print If(use_mesh_coloring_gpu, lambda {
               print working_element === bx
             }, lambda {
               print working_element === d_phase_ispec_inner[bx + num_phase_ispec*(d_iphase-1)]-1
             })
-          @@output.puts "#endif"
+          get_output.puts "#endif"
   
           print iglob === d_ibool[working_element*ngll3 + tx]-1
   
-          @@output.puts "#ifdef #{use_textures_fields}"
+          get_output.puts "#ifdef #{use_textures_fields}"
             print s_dummy_loc[tx] === d_displ_oc_tex[iglob]
-          @@output.puts "#else"
+          get_output.puts "#else"
             print s_dummy_loc[tx] === d_potential[iglob]
-          @@output.puts "#endif"
+          get_output.puts "#endif"
         }
         print If(tx < ngll2) {
-          @@output.puts "#ifdef #{use_textures_constants}"
+          get_output.puts "#ifdef #{use_textures_constants}"
             print sh_hprime_xx[tx] === d_hprime_xx_oc_tex[tx]
             print sh_hprimewgll_xx[tx] === d_hprimewgll_xx_oc_tex[tx]
-          @@output.puts "#else"
+          get_output.puts "#else"
             print sh_hprime_xx[tx] === d_hprime_xx[tx]
             print sh_hprimewgll_xx[tx] === d_hprimewgll_xx[tx]
-          @@output.puts "#endif"
+          get_output.puts "#endif"
   
         }
         print barrier(:local)
@@ -236,11 +236,11 @@ module BOAST
              print templ[1] === templ[1] + s_dummy_loc[k*ngll2+l*ngllx+i]*sh_hprime_xx[l*ngllx+j]
              print templ[2] === templ[2] + s_dummy_loc[l*ngll2+j*ngllx+i]*sh_hprime_xx[l*ngllx+k]
           }
-          @@output.puts "#ifdef #{manually_unrolled_loops}"
+          get_output.puts "#ifdef #{manually_unrolled_loops}"
             for_loop.unroll
-          @@output.puts "#else"
+          get_output.puts "#else"
             print for_loop
-          @@output.puts "#endif"
+          get_output.puts "#endif"
           print offset === working_element*ngll3_padded + tx
           (0..2).each { |indx|
             print xil[indx]    === d_xi[indx][offset]
@@ -314,37 +314,37 @@ module BOAST
              print templ[1] === templ[1] + s_temp[1][k*ngll2+l*ngllx+i]*sh_hprimewgll_xx[j*ngllx+l]
              print templ[2] === templ[2] + s_temp[2][l*ngll2+j*ngllx+i]*sh_hprimewgll_xx[k*ngllx+l]
           }
-          @@output.puts "#ifdef #{manually_unrolled_loops}"
+          get_output.puts "#ifdef #{manually_unrolled_loops}"
             for_loop.unroll
-          @@output.puts "#else"
+          get_output.puts "#else"
             print for_loop
-          @@output.puts "#endif"
+          get_output.puts "#endif"
           print sum_terms === -(wgllwgll_yz[k*ngllx+j]*templ[0] + wgllwgll_xz[k*ngllx+i]*templ[1] + wgllwgll_xy[j*ngllx+i]*templ[2])
   
           print If(gravity) {
             print  sum_terms === sum_terms + gravity_term
           }
-          @@output.puts "#ifdef #{use_mesh_coloring}"
-            @@output.puts "#ifdef #{use_textures_fields}"
+          get_output.puts "#ifdef #{use_mesh_coloring}"
+            get_output.puts "#ifdef #{use_textures_fields}"
               print d_potential_dot_dot[iglob] === d_accel_oc_tex[iglob] + sum_terms
-            @@output.puts "#else"
+            get_output.puts "#else"
               print d_potential_dot_dot[iglob] === d_potential_dot_dot[iglob] + sum_terms
-            @@output.puts "#endif"
-          @@output.puts "#else"
+            get_output.puts "#endif"
+          get_output.puts "#else"
             print If(use_mesh_coloring_gpu, lambda {
               print If(nspec_outer_core > coloring_min_nspec_outer_core, lambda {
-                @@output.puts "#ifdef #{use_textures_fields}"
+                get_output.puts "#ifdef #{use_textures_fields}"
                   print d_potential_dot_dot[iglob] === d_accel_oc_tex[iglob] + sum_terms
-                @@output.puts "#else"
+                get_output.puts "#else"
                   print d_potential_dot_dot[iglob] === d_potential_dot_dot[iglob] + sum_terms
-                @@output.puts "#endif"
+                get_output.puts "#endif"
               }, lambda{
                 print atomicAdd(d_potential_dot_dot+iglob,sum_terms)
               })
             }, lambda {
               print atomicAdd(d_potential_dot_dot+iglob,sum_terms)
             })
-          @@output.puts "#endif"
+          get_output.puts "#endif"
         }
       close p
     else
diff --git a/src/gpu/boast/prepare_boundary_accel_on_device.rb b/src/gpu/boast/prepare_boundary_accel_on_device.rb
index 9af6f95..63e028e 100644
--- a/src/gpu/boast/prepare_boundary_accel_on_device.rb
+++ b/src/gpu/boast/prepare_boundary_accel_on_device.rb
@@ -27,7 +27,7 @@ module BOAST
     variables += [ num_interfaces, max_nibool_interfaces, d_nibool_interfaces, d_ibool_interfaces]
     p = Procedure::new(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CUDA or get_lang == CL) then
       make_specfem3d_header
       open p
diff --git a/src/gpu/boast/update_disp_veloc_kernel.rb b/src/gpu/boast/update_disp_veloc_kernel.rb
index a50b3db..02acd52 100644
--- a/src/gpu/boast/update_disp_veloc_kernel.rb
+++ b/src/gpu/boast/update_disp_veloc_kernel.rb
@@ -50,7 +50,7 @@ module BOAST
 
     p = Procedure(function_name, variables)
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header
       open p
diff --git a/src/gpu/boast/write_seismograms_transfer_from_device_kernel.rb b/src/gpu/boast/write_seismograms_transfer_from_device_kernel.rb
index 7afa2c2..94c1962 100644
--- a/src/gpu/boast/write_seismograms_transfer_from_device_kernel.rb
+++ b/src/gpu/boast/write_seismograms_transfer_from_device_kernel.rb
@@ -28,7 +28,7 @@ module BOAST
 
     p = Procedure(function_name, [number_receiver_global,ispec_selected_rec,ibool,station_field,d_field,nrec_local])
     if (get_lang == CUDA and ref) then
-      @@output.print File::read("references/#{function_name}.cu")
+      get_output.print File::read("references/#{function_name}.cu")
     elsif(get_lang == CL or get_lang == CUDA) then
       make_specfem3d_header( :ngll3 => n_gll3 )
       open p



More information about the CIG-COMMITS mailing list