| 57 | SliceContext() : axis_bitset_(0) {} |
| 58 | |
| 59 | Maybe<void> PushSplitInfo(int64_t split_axis, int64_t lower, int64_t upper, |
| 60 | int64_t logical_length) { |
| 61 | if (split_axis != SPLIT_AXIS_FOR_NON_SPLIT) { |
| 62 | // split_axis can only be push once |
| 63 | CHECK_OR_RETURN(!IsAxisPushed(split_axis)) |
| 64 | << "split_axis " << split_axis << " has been pushed to SliceContext"; |
| 65 | CHECK_GE_OR_RETURN(split_axis, 0) << "split_axis >= 0 or equal to SPLIT_AXIS_FOR_NON_SPLIT"; |
| 66 | |
| 67 | axis_bitset_ |= ((uint32_t)1 << split_axis); // NOLINT |
| 68 | } |
| 69 | split_info_vec_.emplace_back(SplitInfo{split_axis, lower, upper, logical_length}); |
| 70 | return Maybe<void>::Ok(); |
| 71 | } |
| 72 | const std::vector<SplitInfo>& GetSplitInfo() const { return split_info_vec_; } |
| 73 | bool IsAxisPushed(int64_t split_axis) const { |
| 74 | if (split_axis == SPLIT_AXIS_FOR_NON_SPLIT) { return false; } |
no test coverage detected