From bc4e2e9aa248ed3178518fc1cbb7cd235e71ad27 Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Thu, 14 Sep 2023 11:12:16 +0200
Subject: [PATCH] Changed header files structure to work with multiple backends
 and notably backend CPU

---
 include/aidge/{aidge_backend_cuda.hpp => backend/cuda.hpp} | 2 +-
 include/aidge/{ => backend/cuda}/data/TensorImpl.hpp       | 2 +-
 include/aidge/{ => backend/cuda}/utils/CudaUtils.hpp       | 0
 python_binding/pybind_backend_cuda.cpp                     | 2 +-
 unit_tests/Test_TensorImpl.cpp                             | 4 +++-
 unit_tests/Test_cuda.hpp                                   | 2 +-
 6 files changed, 7 insertions(+), 5 deletions(-)
 rename include/aidge/{aidge_backend_cuda.hpp => backend/cuda.hpp} (91%)
 rename include/aidge/{ => backend/cuda}/data/TensorImpl.hpp (98%)
 rename include/aidge/{ => backend/cuda}/utils/CudaUtils.hpp (100%)

diff --git a/include/aidge/aidge_backend_cuda.hpp b/include/aidge/backend/cuda.hpp
similarity index 91%
rename from include/aidge/aidge_backend_cuda.hpp
rename to include/aidge/backend/cuda.hpp
index 57d5f15..f1dbc28 100644
--- a/include/aidge/aidge_backend_cuda.hpp
+++ b/include/aidge/backend/cuda.hpp
@@ -12,6 +12,6 @@
 #ifndef AIDGE_BACKEND_CUDA_IMPORTS_H_
 #define AIDGE_BACKEND_CUDA_IMPORTS_H_
 
-#include "aidge/data/TensorImpl.hpp"
+#include "aidge/backend/cuda/data/TensorImpl.hpp"
 
 #endif /* AIDGE_BACKEND_CUDA_IMPORTS_H_ */
\ No newline at end of file
diff --git a/include/aidge/data/TensorImpl.hpp b/include/aidge/backend/cuda/data/TensorImpl.hpp
similarity index 98%
rename from include/aidge/data/TensorImpl.hpp
rename to include/aidge/backend/cuda/data/TensorImpl.hpp
index fa12344..7840351 100644
--- a/include/aidge/data/TensorImpl.hpp
+++ b/include/aidge/backend/cuda/data/TensorImpl.hpp
@@ -9,7 +9,7 @@
 #include "aidge/utils/Registrar.hpp"
 #include "aidge/utils/Types.h"
 
-#include "aidge/utils/CudaUtils.hpp"
+#include "aidge/backend/cuda/utils/CudaUtils.hpp"
 
 namespace Aidge {
 template <class T>
diff --git a/include/aidge/utils/CudaUtils.hpp b/include/aidge/backend/cuda/utils/CudaUtils.hpp
similarity index 100%
rename from include/aidge/utils/CudaUtils.hpp
rename to include/aidge/backend/cuda/utils/CudaUtils.hpp
diff --git a/python_binding/pybind_backend_cuda.cpp b/python_binding/pybind_backend_cuda.cpp
index 01e682f..4b68621 100644
--- a/python_binding/pybind_backend_cuda.cpp
+++ b/python_binding/pybind_backend_cuda.cpp
@@ -1,6 +1,6 @@
 #include <pybind11/pybind11.h>
 // Need to call this header to register every impl
-#include "aidge/aidge_backend_cuda.hpp"
+#include "aidge/backend/cuda.hpp"
 
 namespace py = pybind11;
 
diff --git a/unit_tests/Test_TensorImpl.cpp b/unit_tests/Test_TensorImpl.cpp
index 56e3ee1..cad4a1a 100644
--- a/unit_tests/Test_TensorImpl.cpp
+++ b/unit_tests/Test_TensorImpl.cpp
@@ -16,7 +16,9 @@
 #include "Test_cuda.hpp"
 
 #include "aidge/data/Tensor.hpp"
-#include "aidge/data/TensorImpl.hpp"
+
+#include "aidge/backend/cpu.hpp"
+#include "aidge/backend/cuda.hpp"
 
 using namespace Aidge;
 
diff --git a/unit_tests/Test_cuda.hpp b/unit_tests/Test_cuda.hpp
index 1d319f0..90f3a9d 100644
--- a/unit_tests/Test_cuda.hpp
+++ b/unit_tests/Test_cuda.hpp
@@ -1,6 +1,6 @@
 #include <cuda.h>
 #include <cuda_runtime.h>
 
-#include "aidge/utils/CudaUtils.hpp"
+#include "aidge/backend/cuda/utils/CudaUtils.hpp"
 
 void vector_add(float *out, float *a, float *b, int n);
-- 
GitLab