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:
committed by
Philip Hyunsu Cho
parent
dade7c3aff
commit
5f151c5cf3
@@ -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_
|
||||
|
||||
20
include/xgboost/build_config.h
Normal file
20
include/xgboost/build_config.h
Normal 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_
|
||||
Reference in New Issue
Block a user