@@ -99,7 +99,6 @@ void ElementWiseKernel(linalg::TensorView<T, D> t, std::int32_t n_threads, Fn&&
9999}
100100} // namespace cpu_impl
101101
102-
103102template <typename T, std::int32_t kDim >
104103auto cbegin (TensorView<T, kDim > const & v) { // NOLINT
105104 auto it = common::MakeIndexTransformIter ([&](std::size_t i) -> std::remove_cv_t <T> const & {
@@ -125,7 +124,9 @@ auto end(TensorView<T, kDim>& v) { // NOLINT
125124 return begin (v) + v.Size ();
126125}
127126
128- // A tag to workaround the one definition rule.
127+ // A tag to workaround the one definition rule. Anything that can function differently in
128+ // two different TUs without change of function signiture can violate this rule. The tag
129+ // is used to create a new function signiture accordingly.
129130template <bool kWithCuda , bool kWithSycl >
130131struct SysTagImpl {};
131132
@@ -226,7 +227,8 @@ void TransformKernel(Context const* ctx, TensorView<T, D> t, Fn&& fn, SysTag = S
226227}
227228
228229// vector-scalar multiplication
229- inline void VecScaMul (Context const * ctx, linalg::VectorView<float > x, double mul, SysTag = SysTag{}) {
230+ inline void VecScaMul (Context const * ctx, linalg::VectorView<float > x, double mul,
231+ SysTag = SysTag{}) {
230232 CHECK_EQ (x.Device ().ordinal , ctx->Device ().ordinal );
231233 TransformKernel (ctx, x, [=] XGBOOST_DEVICE (float v) { return v * mul; });
232234}
0 commit comments