From 1256b2f7012d9da2d34cdb2f94b65b1d5dfd5e20 Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Mon, 29 Mar 2021 15:17:30 +0000
Subject: [PATCH] Added lbmCuda target again.

---
 .../LBM/CumulantK17LBMKernelUnified.cpp               |  6 +++---
 src/gpu/VirtualFluids_GPU/CMakeLists.txt              |  2 +-
 src/lbm/CMakeLists.txt                                |  9 +++++++--
 ...aPreCompiled.cu => CumulantChimeraPreCompiled.cpp} |  0
 src/lbm/cuda/CMakeLists.txt                           | 11 +++++++++++
 5 files changed, 22 insertions(+), 6 deletions(-)
 rename src/lbm/{CumulantChimeraPreCompiled.cu => CumulantChimeraPreCompiled.cpp} (100%)
 create mode 100644 src/lbm/cuda/CMakeLists.txt

diff --git a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernelUnified.cpp b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernelUnified.cpp
index 841ade937..2dfa947f9 100644
--- a/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernelUnified.cpp
+++ b/src/cpu/VirtualFluidsCore/LBM/CumulantK17LBMKernelUnified.cpp
@@ -39,10 +39,10 @@
 #include "Block3D.h"
 #include "BCArray3D.h"
 
-#include <lbm/Chimera.h>
-#include <lbm/CumulantChimera.h>
+//#include <lbm/CumulantChimera.h>
+#include <lbm/CumulantChimeraPreCompiled.h>
 
-#define PROOF_CORRECTNESS
+//#define PROOF_CORRECTNESS
 
 using namespace UbMath;
 
diff --git a/src/gpu/VirtualFluids_GPU/CMakeLists.txt b/src/gpu/VirtualFluids_GPU/CMakeLists.txt
index bda286187..88233e746 100644
--- a/src/gpu/VirtualFluids_GPU/CMakeLists.txt
+++ b/src/gpu/VirtualFluids_GPU/CMakeLists.txt
@@ -5,7 +5,7 @@ if(MSVC)
     set(additional_libraries ws2_32 Traffic) # ws_32 throws an error on Phoenix
 endif()
 
-vf_add_library(PRIVATE_LINK ${additional_libraries} GridGenerator basics MPI::MPI_CXX lbm)
+vf_add_library(PRIVATE_LINK ${additional_libraries} GridGenerator basics MPI::MPI_CXX lbmCuda)
 
 
 linkBoost(COMPONENTS "serialization")
diff --git a/src/lbm/CMakeLists.txt b/src/lbm/CMakeLists.txt
index 6331a0fe7..9efa44b72 100644
--- a/src/lbm/CMakeLists.txt
+++ b/src/lbm/CMakeLists.txt
@@ -1,7 +1,12 @@
-project(lbm LANGUAGES CXX CUDA)
+project(lbm LANGUAGES CXX)
 
 vf_add_library(NAME lbm PUBLIC_LINK basics)
 
+if(BUILD_VF_GPU)
+    add_subdirectory(cuda)
+endif()
+
+
 vf_add_tests()
 
-set_target_properties(lbm PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
+#set_target_properties(lbm PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
diff --git a/src/lbm/CumulantChimeraPreCompiled.cu b/src/lbm/CumulantChimeraPreCompiled.cpp
similarity index 100%
rename from src/lbm/CumulantChimeraPreCompiled.cu
rename to src/lbm/CumulantChimeraPreCompiled.cpp
diff --git a/src/lbm/cuda/CMakeLists.txt b/src/lbm/cuda/CMakeLists.txt
new file mode 100644
index 000000000..78433784b
--- /dev/null
+++ b/src/lbm/cuda/CMakeLists.txt
@@ -0,0 +1,11 @@
+project(lbmCuda LANGUAGES CUDA CXX)
+
+
+vf_add_library(NAME lbmCuda BUILDTYPE static PUBLIC_LINK basics FOLDER ../../lbm)
+
+
+set_target_properties(lbmCuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
+
+
+set_source_files_properties(../CumulantChimeraPreCompiled.cpp PROPERTIES LANGUAGE CUDA)
+#set_source_files_properties(../BackwardChimera.cpp PROPERTIES LANGUAGE CUDA)
-- 
GitLab