From 1fd5dfa8f3a949e410a6fbaa76b14f71852bcd5b Mon Sep 17 00:00:00 2001
From: Christoph Rettinger <christoph.rettinger@fau.de>
Date: Fri, 19 Jun 2020 11:44:58 +0200
Subject: [PATCH] Fixed python dict access

---
 python/lbmpy_walberla/walberla_lbm_generation.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/lbmpy_walberla/walberla_lbm_generation.py b/python/lbmpy_walberla/walberla_lbm_generation.py
index 28a73ea73..b234c8b33 100644
--- a/python/lbmpy_walberla/walberla_lbm_generation.py
+++ b/python/lbmpy_walberla/walberla_lbm_generation.py
@@ -134,15 +134,15 @@ def generate_lattice_model(generation_context, class_name, collision_rule, field
     q = len(lb_method.stencil)
     dim = lb_method.dim
 
+    create_kernel_params = default_create_kernel_parameters(generation_context, create_kernel_params)
+    if create_kernel_params['target'] == 'gpu':
+        raise ValueError("Lattice Models can only be generated for CPUs. To generate LBM on GPUs use sweeps directly")
+
     if field_layout == 'fzyx':
         create_kernel_params['cpu_vectorize_info']['assume_inner_stride_one'] = True
     elif field_layout == 'zyxf':
         create_kernel_params['cpu_vectorize_info']['assume_inner_stride_one'] = False
 
-    create_kernel_params = default_create_kernel_parameters(generation_context, create_kernel_params)
-    if create_kernel_params['target'] == 'gpu':
-        raise ValueError("Lattice Models can only be generated for CPUs. To generate LBM on GPUs use sweeps directly")
-
     src_field = ps.Field.create_generic('pdfs', dim, dtype, index_dimensions=1, layout=field_layout, index_shape=(q,))
     dst_field = ps.Field.create_generic('pdfs_tmp', dim, dtype, index_dimensions=1, layout=field_layout, index_shape=(q,))
 
-- 
GitLab