From 6e415fb0cb700f3b9c74ea297d0ff98bde9859ea Mon Sep 17 00:00:00 2001
From: David Hammer <dhammer@mailbox.org>
Date: Wed, 1 Dec 2021 09:11:34 +0100
Subject: [PATCH] Renaming kernel files

---
 src/calng/agipd_gpu.py                                    | 2 +-
 src/calng/base_gpu.py                                     | 2 +-
 src/calng/dssc_gpu.py                                     | 2 +-
 src/calng/{agipd_gpu_kernels.cpp => kernels/agipd_gpu.cu} | 0
 src/calng/{dssc_gpu_kernels.cpp => kernels/dssc_gpu.cu}   | 0
 5 files changed, 3 insertions(+), 3 deletions(-)
 rename src/calng/{agipd_gpu_kernels.cpp => kernels/agipd_gpu.cu} (100%)
 rename src/calng/{dssc_gpu_kernels.cpp => kernels/dssc_gpu.cu} (100%)

diff --git a/src/calng/agipd_gpu.py b/src/calng/agipd_gpu.py
index df1bc811..98d26c54 100644
--- a/src/calng/agipd_gpu.py
+++ b/src/calng/agipd_gpu.py
@@ -25,7 +25,7 @@ class AgipdGainMode(enum.IntEnum):
 
 
 class AgipdGpuRunner(base_gpu.BaseGpuRunner):
-    _kernel_source_filename = "agipd_gpu_kernels.cpp"
+    _kernel_source_filename = "agipd_gpu.cu"
     _corrected_axis_order = "cxy"
 
     def __init__(
diff --git a/src/calng/base_gpu.py b/src/calng/base_gpu.py
index 5a4821a0..903cb1e3 100644
--- a/src/calng/base_gpu.py
+++ b/src/calng/base_gpu.py
@@ -44,7 +44,7 @@ class BaseGpuRunner:
     ):
         _src_dir = pathlib.Path(__file__).absolute().parent
         # subclass must define _kernel_source_filename
-        with (_src_dir / self._kernel_source_filename).open("r") as fd:
+        with (_src_dir / "kernels" / self._kernel_source_filename).open("r") as fd:
             self._kernel_template = jinja2.Template(fd.read())
 
         self.pixels_x = pixels_x
diff --git a/src/calng/dssc_gpu.py b/src/calng/dssc_gpu.py
index 138e3016..b9dc3b09 100644
--- a/src/calng/dssc_gpu.py
+++ b/src/calng/dssc_gpu.py
@@ -12,7 +12,7 @@ class CorrectionFlags(enum.IntFlag):
 
 
 class DsscGpuRunner(base_gpu.BaseGpuRunner):
-    _kernel_source_filename = "dssc_gpu_kernels.cpp"
+    _kernel_source_filename = "dssc_gpu.cu"
     _corrected_axis_order = "cyx"
 
     def __init__(
diff --git a/src/calng/agipd_gpu_kernels.cpp b/src/calng/kernels/agipd_gpu.cu
similarity index 100%
rename from src/calng/agipd_gpu_kernels.cpp
rename to src/calng/kernels/agipd_gpu.cu
diff --git a/src/calng/dssc_gpu_kernels.cpp b/src/calng/kernels/dssc_gpu.cu
similarity index 100%
rename from src/calng/dssc_gpu_kernels.cpp
rename to src/calng/kernels/dssc_gpu.cu
-- 
GitLab