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

Add cuda compiler version in showCudaVersion.

parent 7f92f2f6
No related branches found
No related tags found
2 merge requests!32version 0.2.1,!17Show cuda version during compilation.
Pipeline #45489 passed
......@@ -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