diff --git a/CMakeLists.txt b/CMakeLists.txt index 21f57bc75b2fa4ad8b57711b092693c70b20d628..e31509842a876151c31473d89f7e242f61617544 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ file(READ "${CMAKE_SOURCE_DIR}/project_name.txt" project) message(STATUS "Project name: ${project}") message(STATUS "Project version: ${version}") -# Note : project name is {project} and python module name is also {project} +# Note : project name is {project} and python module name is also {project} set(module_name _${project}) # target name @@ -36,8 +36,9 @@ enable_language(CUDA) find_package(CUDAToolkit REQUIRED) find_package(aidge_core REQUIRED) -find_package(aidge_backend_cpu REQUIRED) - +if(TEST) + find_package(aidge_backend_cpu REQUIRED) +endif() ############################################## # Create target and set properties @@ -48,11 +49,17 @@ add_library(${module_name} ${src_files} ${inc_files}) target_link_libraries(${module_name} PUBLIC _aidge_core # _ is added because we link the target not the project - _aidge_backend_cpu # _ is added because we link the target not the project CUDA::cudart cudnn ) +if(TEST) + target_link_libraries(${module_name} + PUBLIC + _aidge_backend_cpu # _ is added because we link the target not the project + ) +endif() + #Set target properties target_include_directories(${module_name} PUBLIC @@ -76,7 +83,7 @@ if (PYBIND) # Handles Python + pybind11 headers dependencies target_link_libraries(${module_name} - PUBLIC + PUBLIC pybind11::pybind11 PRIVATE Python::Python @@ -119,8 +126,8 @@ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(EXPORT ${project}-targets FILE "${project}-targets.cmake" DESTINATION ${INSTALL_CONFIGDIR} -# COMPONENT ${module_name} -) +# COMPONENT ${module_name} +) #Create a ConfigVersion.cmake file include(CMakePackageConfigHelpers) diff --git a/include/aidge/backend/cuda/data/TensorImpl.hpp b/include/aidge/backend/cuda/data/TensorImpl.hpp index f7de7aaf434ddf8a19f225f1c5db49780fde88d2..8b62b2dadb9de7857edc343dcddcbac3cbd06920 100644 --- a/include/aidge/backend/cuda/data/TensorImpl.hpp +++ b/include/aidge/backend/cuda/data/TensorImpl.hpp @@ -24,8 +24,8 @@ void thrust_copy(const half_float::half* srcData, half_float::half* dstData, siz /** * @brief Abstract class for the TensorImpl_cuda class template. - * @details Its purpose is to provide access to base methods that are specific - * to the implementation (which are therefore not present in the TensorImpl + * @details Its purpose is to provide access to base methods that are specific + * to the implementation (which are therefore not present in the TensorImpl * class), but whose data type does not need to be known. */ class TensorImpl_cuda_ { @@ -35,7 +35,7 @@ protected: public: /** * @brief Return the CuDNN tensor descriptor of the tensor. - * @details This method uses lazy initialization for the descriptor + * @details This method uses lazy initialization for the descriptor * (which is therefore mutable in the derived class). * @return cudnnTensorDescriptor_t CuDNN tensor descriptor. */ @@ -80,7 +80,7 @@ public: // native interface const future_std::span<T>& data() const { return mData; } - std::size_t scalarSize() const override { return sizeof(T); } + std::size_t scalarSize() const noexcept override { return sizeof(T); } void copy(const void *src, NbElts_t length, NbElts_t offset = 0) override { AIDGE_ASSERT(length <= mData.size() || length <= mNbElts, "copy length is above capacity"); diff --git a/setup.py b/setup.py index dbf82e2826065c812a3bea5f5e1d34557b79f00d..80500f3165dd87eb7b6dd73c78b89806cc8a874a 100644 --- a/setup.py +++ b/setup.py @@ -62,10 +62,10 @@ class CMakeBuild(build_ext): os.chdir(str(build_temp)) - # Impose to use the executable of the python + # Impose to use the executable of the python # used to launch setup.py to setup PythonInterp param_py = "-DPYTHON_EXECUTABLE=" + sys.executable - + compile_type = 'Debug' install_path = os.path.join(sys.prefix, "lib", "libAidge") if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"] @@ -85,11 +85,11 @@ class CMakeBuild(build_ext): for file in files: if (file.endswith('.so') or file.endswith('.pyd')) and (root != str(aidge_package.absolute())): currentFile=os.path.join(root, file) - shutil.copy(currentFile, str(aidge_package.absolute())) + shutil.copy(currentFile, str(aidge_package.absolute())) # Copy version.txt in aidge_package os.chdir(os.path.dirname(__file__)) - shutil.copy("version.txt", str(aidge_package.absolute())) + shutil.copy("version.txt", str(aidge_package.absolute())) if __name__ == '__main__': @@ -108,7 +108,7 @@ if __name__ == '__main__': cmdclass={ 'build_ext': CMakeBuild, }, - install_requires=['aidge_core', 'aidge_backend_cpu'], + install_requires=['aidge_core'], zip_safe=False, )