Workaround compiler error. (#7745)

This commit is contained in:
Jiaming Yuan 2022-03-25 17:05:14 +08:00 committed by GitHub
parent 64575591d8
commit af0cf88921
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,8 @@
#ifndef XGBOOST_TASK_H_
#define XGBOOST_TASK_H_
#include <xgboost/base.h>
#include <cinttypes>
namespace xgboost {
@ -35,7 +37,7 @@ struct ObjInfo {
explicit ObjInfo(Task t) : task{t} {}
ObjInfo(Task t, bool khess) : task{t}, const_hess{khess} {}
constexpr bool UseOneHot() const {
XGBOOST_DEVICE bool UseOneHot() const {
return (task != ObjInfo::kRegression && task != ObjInfo::kBinary);
}
};