From 402f38abb625c0c5301370f1e85f34e7ed944056 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Thu, 28 Feb 2019 10:28:22 +0100
Subject: [PATCH] fixed advectiona autotuning

---
 .../device/opencl/autotunable_kernels/advection_dir.py     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hysop/backend/device/opencl/autotunable_kernels/advection_dir.py b/hysop/backend/device/opencl/autotunable_kernels/advection_dir.py
index 5a1025eba..35fff01b7 100644
--- a/hysop/backend/device/opencl/autotunable_kernels/advection_dir.py
+++ b/hysop/backend/device/opencl/autotunable_kernels/advection_dir.py
@@ -61,7 +61,7 @@ class OpenClAutotunableDirectionalAdvectionKernel(OpenClAutotunableKernel):
         vboundaries = (velocity.global_lboundaries[-1], velocity.global_rboundaries[-1])
         
         eps = npw.finfo(precision).eps
-        dt = velocity_cfl
+        dt = velocity_cfl * velocity.space_step[-1]
 
         make_offset, offset_dtype = self.make_array_offset()
         make_strides, strides_dtype = self.make_array_strides(position.dim,
@@ -84,7 +84,7 @@ class OpenClAutotunableDirectionalAdvectionKernel(OpenClAutotunableKernel):
         target_args['P_offset']  = make_offset(position.sdata.offset,   position.dtype)
 
         isolation_params['V_base'] = dict(count=velocity.npoints,
-                dtype=velocity.dtype, fill=0.05)
+                dtype=velocity.dtype, fill=1.00)
         isolation_params['P_base'] = dict(count=position.npoints,
                 dtype=position.dtype, fill=0.00)
 
@@ -194,7 +194,7 @@ class OpenClAutotunableDirectionalAdvectionKernel(OpenClAutotunableKernel):
         Vr                 = extra_kwds['Vr']
         is_bilevel         = extra_kwds['is_bilevel']
 
-        if is_bilevel is not None and local_work_size is not None:
+        if (is_bilevel is not None) and (local_work_size is not None):
             local_work_size[0] = is_bilevel[-1]
 
         ## Get compile time OpenCL known variables
@@ -241,3 +241,4 @@ class OpenClAutotunableDirectionalAdvectionKernel(OpenClAutotunableKernel):
                     'known_args')
         return self.custom_hash(*tuple(extra_kwds[kwd] for kwd in kwds),
                                 mesh_info_vars=extra_kwds['mesh_info_vars'])
+
-- 
GitLab