Skip to content
Snippets Groups Projects
Commit d8427a1b authored by Cyril Moineau's avatar Cyril Moineau Committed by Cyril Moineau
Browse files

Add cuda compiler version in showCudaVersion.

parent 078d8ead
No related branches found
No related tags found
1 merge request!200.2.1
Pipeline #45712 skipped
......@@ -2,11 +2,24 @@
cmake_minimum_required(VERSION 3.18)
file(READ "${CMAKE_SOURCE_DIR}/version.txt" version)
add_definitions(-DPROJECT_VERSION="${version}")
file(READ "${CMAKE_SOURCE_DIR}/project_name.txt" project)
message(STATUS "Project name: ${project}")
message(STATUS "Project version: ${version}")
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Latest git commit: ${GIT_COMMIT_HASH}")
# Define a preprocessor macro with the Git commit version
add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
# Note : project name is {project} and python module name is also {project}
set(module_name _${project}) # target name
......@@ -33,7 +46,9 @@ endif()
enable_language(CUDA)
message(STATUS "CMAKE_CUDA_COMPILER_VERSION = ${CMAKE_CUDA_COMPILER_VERSION}")
message(STATUS "Cuda compiler version = ${CMAKE_CUDA_COMPILER_VERSION}")
# Define a preprocessor macro with the Cuda compiler version
add_definitions(-DCUDA_COMPILER_VERSION="${CMAKE_CUDA_COMPILER_VERSION}")
##############################################
......
......@@ -6,7 +6,18 @@
namespace Aidge {
#ifndef PROJECT_VERSION // Normally defined in CMakeLists.txt
#define PROJECT_VERSION "Unknown version"
#endif
#ifndef GIT_COMMIT_HASH
#define GIT_COMMIT_HASH ""
#endif
#ifndef CUDA_COMPILER_VERSION
#define CUDA_COMPILER_VERSION "Unknown version"
#endif
void showCudaVersion() {
Log::info("Aidge backend CUDA: {} ({}), {} {}", PROJECT_VERSION, GIT_COMMIT_HASH, __DATE__, __TIME__);
Log::info("CUDA compiler version: {}", CUDA_COMPILER_VERSION);
Log::info("CuDNN version: {}.{}.{}\n", CUDNN_MAJOR, CUDNN_MINOR,
CUDNN_PATCHLEVEL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment