Performance optimizations for Intel CPUs (#3957)

* Initial performance optimizations for xgboost

* remove includes

* revert float->double

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* fix for CI

* Check existence of _mm_prefetch and __builtin_prefetch

* Fix lint
This commit is contained in:
Egor Smirnov
2019-01-09 08:08:13 +03:00
committed by Philip Hyunsu Cho
parent dade7c3aff
commit 5f151c5cf3
7 changed files with 145 additions and 43 deletions

View File

@@ -218,4 +218,8 @@ using bst_omp_uint = dmlc::omp_uint; // NOLINT
#endif
#endif
} // namespace xgboost
/* Always keep this #include at the bottom of xgboost/base.h */
#include <xgboost/build_config.h>
#endif // XGBOOST_BASE_H_

View File

@@ -0,0 +1,20 @@
/*!
* Copyright (c) 2018 by Contributors
* \file build_config.h
* \brief Fall-back logic for platform-specific feature detection.
* \author Hyunsu Philip Cho
*/
#ifndef XGBOOST_BUILD_CONFIG_H_
#define XGBOOST_BUILD_CONFIG_H_
/* default logic for software pre-fetching */
#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))) || defined(__INTEL_COMPILER)
// Enable _mm_prefetch for Intel compiler and MSVC+x86
#define XGBOOST_MM_PREFETCH_PRESENT
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
#elif defined(__GNUC__)
// Enable __builtin_prefetch for GCC
#define XGBOOST_BUILTIN_PREFETCH_PRESENT
#endif
#endif // XGBOOST_BUILD_CONFIG_H_