Skip to content

Commit 8497a18

Browse files
add comment about hint
1 parent 3be9213 commit 8497a18

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpp/daal/src/algorithms/dtrees/forest/regression/df_regression_train_dense_default_impl.i

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ void OrderedRespHelperBest<algorithmFPType, cpu>::calcImpurity(const IndexType *
219219
{
220220
const size_t iStart = iMain * simdBatchSize;
221221
#if defined(__GNUC__) && !defined(__clang__)
222+
// Note: GCC is unable to determine that the pointer offset plus the
223+
// vectorized section will be within the limits of pointer ranges
224+
// from the start of the array, and without this hint, ends up issuing
225+
// a warning about undefined behavior when loops exceed 2^63. This
226+
// attribute leads to a compilation error with LLVM-based compilers,
227+
// so it's defined conditionally regardless of compiler support.
222228
__attribute__((__assume__(iStart < std::numeric_limits<std::ptrdiff_t>::max())));
223229
#endif
224230
const auto aIdxStart = aIdx + iStart;

0 commit comments

Comments
 (0)