From 9513cb959048d003b240b85071a965568f5fd0e5 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Tue, 5 Jul 2016 13:59:52 +0200
Subject: [PATCH] order ok

---
 CMakeLists.txt              | 5 +++--
 hysop/gpu/gpu_stretching.py | 9 +++++----
 hysop/gpu/tools.py          | 2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d295a9c9b..2c2a74735 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -179,7 +179,7 @@ endif()
 
 # --- FFTW ---
 if(WITH_FFTW)
-    set(FIND_FFTW_VERBOSE OFF)
+    set(FIND_FFTW_VERBOSE VERBOSE_MODE)
     set(FIND_FFTW_DEBUG OFF)
     compile_with(FFTW 
       REQUIRED COMPONENTS Fftw3d Fftw3f Fftw3d-mpi Fftw3f-mpi
@@ -517,7 +517,8 @@ if(VERBOSE_MODE)
   message(STATUS " Project uses Scales : ${WITH_SCALES}")
   message(STATUS " Project uses FFTW : ${WITH_FFTW}")
   message(STATUS " Project uses GPU : ${WITH_GPU}")
-  message(STATUS " ${PROJECT_NAME} debug mode : ${DEBUG}")
+  message(STATUS " ${PROJECT_NAME} profile mode : ${PROFILE}")
+  message(STATUS " ${PROJECT_NAME} debug   mode : ${DEBUG}")
   message(STATUS " Enable -OO run? : ${OPTIM}")
   message(STATUS "====================== ======= ======================")
   message(STATUS " ")
diff --git a/hysop/gpu/gpu_stretching.py b/hysop/gpu/gpu_stretching.py
index 15a3be2ac..e6aa7cc41 100644
--- a/hysop/gpu/gpu_stretching.py
+++ b/hysop/gpu/gpu_stretching.py
@@ -54,6 +54,9 @@ class GPUStretching(DiscreteOperator, GPUOperator):
         self.vorticity = vorticity
         self.velocity  = velocity
         
+        # order of spatial scheme
+        self.order = 2 if self.method[SpaceDiscretisation] is FDC2 else 4
+        
         # Worksize handling
         #TODO
         self._cl_work_size = 0
@@ -128,7 +131,6 @@ class GPUStretching(DiscreteOperator, GPUOperator):
                 hostbuf=mesh_info)
         self.mesh_info_buffer = mesh_info_buffer
         
-        
         kernels = {}
         kernels['stretching'] = KernelLauncher(prg.all_kernels()[0], self.cl_env.queue, 
                 gwi, lwi)
@@ -142,7 +144,7 @@ class GPUStretching(DiscreteOperator, GPUOperator):
         context       = cl_env.ctx
         work_dim      = self.dim 
         symbolic_mode = True
-        order         = 2
+        order         = self.order
         known_vars    = { 'local_size':  lwi }
 
         codegen = CachedStretchingKernel(typegen=typegen,
@@ -176,8 +178,7 @@ class GPUStretching(DiscreteOperator, GPUOperator):
         stretching_evt = self.kernels['stretching'](*kernel_args, wait_for=input_events)
         
         if to_host:
-            for field in self.variables:
-                field.toHost()
+            self.vorticity.toHost()
 
     def apply(self, simulation):
         self._compute(simulation)
diff --git a/hysop/gpu/tools.py b/hysop/gpu/tools.py
index 82f9d5b73..7fc2d7e7d 100644
--- a/hysop/gpu/tools.py
+++ b/hysop/gpu/tools.py
@@ -73,6 +73,8 @@ class OpenCLEnvironment(object):
 
         # Floating point precision
         from hysop.codegen.base.types import OpenClTypeGen
+        print '__VERBOSE__',__VERBOSE__
+        print '__DEBUG__',__DEBUG__
         if __VERBOSE__ or __DEBUG__:
             float_dump_mode='dec'
         else:
-- 
GitLab