Skip to content

Commit 21364d3

Browse files
committed
notes, lint.
1 parent ab8115a commit 21364d3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/common/linalg_op.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ void ElementWiseKernel(linalg::TensorView<T, D> t, std::int32_t n_threads, Fn&&
9999
}
100100
} // namespace cpu_impl
101101

102-
103102
template <typename T, std::int32_t kDim>
104103
auto 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.
129130
template <bool kWithCuda, bool kWithSycl>
130131
struct 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

Comments
 (0)