From 474cfddf9106bee3afeca6caf4c0b450a34d8f93 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Sat, 25 Apr 2020 13:34:36 -0700 Subject: [PATCH] [R] Address warnings to comply with CRAN submission policy (#5600) * [R] Address warnings to comply with CRAN submission policy * Include --- R-package/vignettes/xgboostPresentation.Rmd | 2 +- include/xgboost/span.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R-package/vignettes/xgboostPresentation.Rmd b/R-package/vignettes/xgboostPresentation.Rmd index 17283c915..6d1bab706 100644 --- a/R-package/vignettes/xgboostPresentation.Rmd +++ b/R-package/vignettes/xgboostPresentation.Rmd @@ -410,7 +410,7 @@ In some very specific cases, like when you want to pilot **XGBoost** from `caret ```{r saveLoadRBinVectorModel, message=F, warning=F} # save model to R's raw vector -rawVec <- xgb.save.raw(bst) +rawVec <- xgb.serialize(bst) # print class print(class(rawVec)) diff --git a/include/xgboost/span.h b/include/xgboost/span.h index 4850d7543..29b0b9a79 100644 --- a/include/xgboost/span.h +++ b/include/xgboost/span.h @@ -30,6 +30,7 @@ #define XGBOOST_SPAN_H_ #include +#include #include // size_t #include // numeric_limits @@ -85,9 +86,11 @@ namespace common { } \ } while (0); -#ifdef __CUDA_ARCH__ +#if defined(__CUDA_ARCH__) #define SPAN_CHECK KERNEL_CHECK -#else +#elif defined(XGBOOST_STRICT_R_MODE) && XGBOOST_STRICT_R_MODE == 1 // R package +#define SPAN_CHECK CHECK // check from dmlc +#else // not CUDA, not R #define SPAN_CHECK(cond) \ do { \ if (XGBOOST_EXPECT(!(cond), false)) { \