From 2ccf2d5d6d30635b5f1a3e8eb8f87a4333c35794 Mon Sep 17 00:00:00 2001
From: markus holzer <markus.holzer@fau.de>
Date: Thu, 19 Nov 2020 15:54:34 +0100
Subject: [PATCH] Enable CPU creation always

---
 apps/showcases/PhaseFieldAllenCahn/CMakeLists.txt  |  2 --
 .../PhaseFieldAllenCahn/CPU/CMakeLists.txt         |  2 +-
 .../PhaseFieldAllenCahn/CPU/multiphase_codegen.py  | 14 +++++++-------
 .../PhaseFieldAllenCahn/GPU/CMakeLists.txt         |  2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/apps/showcases/PhaseFieldAllenCahn/CMakeLists.txt b/apps/showcases/PhaseFieldAllenCahn/CMakeLists.txt
index ed6d22966..9084c99a8 100644
--- a/apps/showcases/PhaseFieldAllenCahn/CMakeLists.txt
+++ b/apps/showcases/PhaseFieldAllenCahn/CMakeLists.txt
@@ -1,6 +1,4 @@
-if ( NOT WALBERLA_BUILD_WITH_CUDA)
 add_subdirectory( CPU )
-endif()
 
 if ( WALBERLA_BUILD_WITH_CUDA)
 add_subdirectory( GPU )
diff --git a/apps/showcases/PhaseFieldAllenCahn/CPU/CMakeLists.txt b/apps/showcases/PhaseFieldAllenCahn/CPU/CMakeLists.txt
index b155b2f5b..0e8f653f7 100644
--- a/apps/showcases/PhaseFieldAllenCahn/CPU/CMakeLists.txt
+++ b/apps/showcases/PhaseFieldAllenCahn/CPU/CMakeLists.txt
@@ -13,7 +13,7 @@ waLBerla_generate_target_from_python(NAME PhaseFieldCodeGenCPU
         stream_hydro.cpp stream_hydro.h
         GenDefines.h)
 
-waLBerla_add_executable(NAME multiphase
+waLBerla_add_executable(NAME multiphaseCPU
         FILES multiphase.cpp PythonExports.cpp InitializerFunctions.cpp contact.cpp CalculateNormals.cpp multiphase_codegen.py
         DEPENDS blockforest core field postprocessing lbm geometry timeloop gui PhaseFieldCodeGenCPU)
 
diff --git a/apps/showcases/PhaseFieldAllenCahn/CPU/multiphase_codegen.py b/apps/showcases/PhaseFieldAllenCahn/CPU/multiphase_codegen.py
index 2175114e8..497e00299 100644
--- a/apps/showcases/PhaseFieldAllenCahn/CPU/multiphase_codegen.py
+++ b/apps/showcases/PhaseFieldAllenCahn/CPU/multiphase_codegen.py
@@ -164,24 +164,24 @@ with CodeGeneration() as ctx:
     if not ctx.optimize_for_localhost:
         cpu_vec = {'instruction_set': None}
 
-    generate_sweep(ctx, 'initialize_phase_field_distributions', h_updates)
-    generate_sweep(ctx, 'initialize_velocity_based_distributions', g_updates)
+    generate_sweep(ctx, 'initialize_phase_field_distributions', h_updates, target='cpu')
+    generate_sweep(ctx, 'initialize_velocity_based_distributions', g_updates, target='cpu')
 
     generate_sweep(ctx, 'phase_field_LB_step', phase_field_LB_step,
                    field_swaps=[(h, h_tmp)],
                    inner_outer_split=True,
-                   cpu_vectorize_info=cpu_vec)
-    generate_boundary(ctx, 'phase_field_LB_NoSlip', NoSlip(), method_phase)
+                   cpu_vectorize_info=cpu_vec, target='cpu')
+    generate_boundary(ctx, 'phase_field_LB_NoSlip', NoSlip(), method_phase, target='cpu')
 
     generate_sweep(ctx, 'hydro_LB_step', hydro_LB_step,
                    inner_outer_split=True,
-                   cpu_vectorize_info=cpu_vec)
-    generate_boundary(ctx, 'hydro_LB_NoSlip', NoSlip(), method_hydro)
+                   cpu_vectorize_info=cpu_vec, target='cpu')
+    generate_boundary(ctx, 'hydro_LB_NoSlip', NoSlip(), method_hydro, target='cpu')
 
     generate_sweep(ctx, 'stream_hydro', stream_hydro,
                    field_swaps=[(g, g_tmp)],
                    inner_outer_split=True,
-                   cpu_vectorize_info=cpu_vec)
+                   cpu_vectorize_info=cpu_vec, target='cpu')
 
     ctx.write_file("GenDefines.h", info_header)
 
diff --git a/apps/showcases/PhaseFieldAllenCahn/GPU/CMakeLists.txt b/apps/showcases/PhaseFieldAllenCahn/GPU/CMakeLists.txt
index e2982ff93..c65a87749 100644
--- a/apps/showcases/PhaseFieldAllenCahn/GPU/CMakeLists.txt
+++ b/apps/showcases/PhaseFieldAllenCahn/GPU/CMakeLists.txt
@@ -16,7 +16,7 @@ waLBerla_generate_target_from_python(NAME PhaseFieldCodeGenGPU
         PackInfo_velocity_based_distributions.cu PackInfo_velocity_based_distributions.h
         GenDefines.h)
 
-waLBerla_add_executable(NAME multiphase
+waLBerla_add_executable(NAME multiphaseGPU
         FILES multiphase.cpp PythonExports.cpp InitializerFunctions.cpp CalculateNormals.cpp contact.cu multiphase_codegen.py
         DEPENDS blockforest core cuda field postprocessing lbm geometry timeloop gui PhaseFieldCodeGenGPU)
 
-- 
GitLab