[arrayfire] 10/84: Move AF_REVISION and AF_COMPILER_STR to backend/version.hpp
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Jan 4 23:22:14 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository arrayfire.
commit 2287c5ca6a3a5c99bb32d1378f0573126f711a78
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date: Tue Dec 8 14:20:39 2015 -0500
Move AF_REVISION and AF_COMPILER_STR to backend/version.hpp
* AF_REVISION was in version.h which is included in defines.h
* Which meant with each new commit, the entire source would have to be
rebuilt
* AF_REVISION is only required by src/backend/*/platform.cpp
* So AF_REVISION has been moved into backend/version.hpp and is compiled into
the library
* Renamed AF_CMPLR_STR to AF_COMPILER_STR
* Moved AF_COMPILER_STR into version.hpp as it is also only required by
backend/platform.cpp
* src/backend/version.hpp is generated by CMake using Version.cmake
and version.hpp.in
---
.gitignore | 1 +
CMakeModules/Version.cmake | 5 +++++
CMakeModules/version.h.in | 2 --
CMakeModules/{version.h.in => version.hpp.in} | 7 +------
src/backend/cpu/platform.cpp | 5 +++--
src/backend/cuda/platform.cpp | 1 +
src/backend/opencl/platform.cpp | 1 +
7 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/.gitignore b/.gitignore
index 75fa897..948b596 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,5 @@ GRTAGS
GPATH
.dir-locals.el
include/af/version.h
+src/backend/version.hpp
docs/details/examples.dox
diff --git a/CMakeModules/Version.cmake b/CMakeModules/Version.cmake
index a9c78fc..cd5149b 100644
--- a/CMakeModules/Version.cmake
+++ b/CMakeModules/Version.cmake
@@ -36,3 +36,8 @@ CONFIGURE_FILE(
${CMAKE_MODULE_PATH}/version.h.in
${CMAKE_SOURCE_DIR}/include/af/version.h
)
+
+CONFIGURE_FILE(
+ ${CMAKE_MODULE_PATH}/version.hpp.in
+ ${CMAKE_SOURCE_DIR}/src/backend/version.hpp
+)
diff --git a/CMakeModules/version.h.in b/CMakeModules/version.h.in
index 99ee03f..6af8d45 100644
--- a/CMakeModules/version.h.in
+++ b/CMakeModules/version.h.in
@@ -14,5 +14,3 @@
#define AF_VERSION_MINOR @AF_VERSION_MINOR@
#define AF_VERSION_PATCH @AF_VERSION_PATCH@
#define AF_API_VERSION_CURRENT @AF_API_VERSION_CURRENT@
-#define AF_REVISION "@GIT_COMMIT_HASH@"
-#define AF_CMPLR_STR "@AF_COMPILER_STRING@"
diff --git a/CMakeModules/version.h.in b/CMakeModules/version.hpp.in
similarity index 59%
copy from CMakeModules/version.h.in
copy to CMakeModules/version.hpp.in
index 99ee03f..f4c9ec6 100644
--- a/CMakeModules/version.h.in
+++ b/CMakeModules/version.hpp.in
@@ -9,10 +9,5 @@
#pragma once
-#define AF_VERSION "@AF_VERSION@"
-#define AF_VERSION_MAJOR @AF_VERSION_MAJOR@
-#define AF_VERSION_MINOR @AF_VERSION_MINOR@
-#define AF_VERSION_PATCH @AF_VERSION_PATCH@
-#define AF_API_VERSION_CURRENT @AF_API_VERSION_CURRENT@
#define AF_REVISION "@GIT_COMMIT_HASH@"
-#define AF_CMPLR_STR "@AF_COMPILER_STRING@"
+#define AF_COMPILER_STR "@AF_COMPILER_STRING@"
diff --git a/src/backend/cpu/platform.cpp b/src/backend/cpu/platform.cpp
index 2b99037..4d96a37 100644
--- a/src/backend/cpu/platform.cpp
+++ b/src/backend/cpu/platform.cpp
@@ -15,6 +15,7 @@
#include <iostream>
#include <string>
#include <defines.hpp>
+#include <version.hpp>
#ifdef _WIN32
#include <limits.h>
@@ -203,7 +204,7 @@ std::string getInfo()
info << string("[0] ") << cinfo.vendor() <<": " << cinfo.model() << " ";
info << "Max threads("<< cinfo.threads()<<") ";
#ifndef NDEBUG
- info << AF_CMPLR_STR;
+ info << AF_COMPILER_STR;
#endif
info << std::endl;
return info.str();
@@ -220,7 +221,7 @@ void devprop(char* d_name, char* d_platform, char *d_toolkit, char* d_compute)
snprintf(d_name, 64, "%s", cinfo.vendor().c_str());
snprintf(d_platform, 10, "CPU");
// report the compiler for toolkit
- snprintf(d_toolkit, 64, "%s", AF_CMPLR_STR);
+ snprintf(d_toolkit, 64, "%s", AF_COMPILER_STR);
snprintf(d_compute, 10, "%s", "0.0");
}
diff --git a/src/backend/cuda/platform.cpp b/src/backend/cuda/platform.cpp
index c154a7e..76b336c 100644
--- a/src/backend/cuda/platform.cpp
+++ b/src/backend/cuda/platform.cpp
@@ -11,6 +11,7 @@
#include <af/cuda.h>
#include <platform.hpp>
#include <defines.hpp>
+#include <version.hpp>
#include <driver.h>
#include <vector>
#include <string>
diff --git a/src/backend/opencl/platform.cpp b/src/backend/opencl/platform.cpp
index 85364c4..16fb3e0 100644
--- a/src/backend/opencl/platform.cpp
+++ b/src/backend/opencl/platform.cpp
@@ -27,6 +27,7 @@
#include <af/version.h>
#include <af/opencl.h>
#include <defines.hpp>
+#include <version.hpp>
#include <platform.hpp>
#include <functional>
#include <algorithm>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list