[Breaking] Add global versioning. (#4936)
* Use CMake config file for representing version. * Generate c and Python version file with CMake. The generated file is written into source tree. But unless XGBoost upgrades its version, there will be no actual modification. This retains compatibility with Makefiles for R. * Add XGBoost version the DMatrix binaries. * Simplify prefetch detection in CMakeLists.txt
This commit is contained in:
@@ -149,6 +149,18 @@ struct XGBAPIThreadLocalEntry {
|
||||
std::vector<GradientPair> tmp_gpair;
|
||||
};
|
||||
|
||||
XGB_DLL void XGBoostVersion(int* major, int* minor, int* patch) {
|
||||
if (major) {
|
||||
*major = XGBOOST_VER_MAJOR;
|
||||
}
|
||||
if (minor) {
|
||||
*minor = XGBOOST_VER_MINOR;
|
||||
}
|
||||
if (patch) {
|
||||
*patch = XGBOOST_VER_PATCH;
|
||||
}
|
||||
}
|
||||
|
||||
// define the threadlocal store.
|
||||
using XGBAPIThreadLocalStore = dmlc::ThreadLocalStore<XGBAPIThreadLocalEntry>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user