Skip to content

Commit 8917c0a

Browse files
author
Siyuan Feng
committed
fix lint
1 parent 1258350 commit 8917c0a

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

python/tvm/tir/schedule/schedule.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,9 @@ def after_cache_read(a: ty.handle, b: ty.handle) -> None:
853853
B[vi, vj] = A_local[vi, vj] * 2.0
854854
855855
"""
856-
return _ffi_api.ScheduleCacheRead(self, block, read_buffer_index, storage_scope) # type: ignore # pylint: disable=no-member
856+
return _ffi_api.ScheduleCacheRead( # type: ignore # pylint: disable=no-member
857+
self, block, read_buffer_index, storage_scope
858+
)
857859

858860
def cache_write(self, block: BlockRV, write_buffer_index: int, storage_scope: str) -> BlockRV:
859861
"""Create a block that reads a buffer region into a write cache. It requires:
@@ -919,7 +921,9 @@ def after_cache_write(a: ty.handle, b: ty.handle) -> None:
919921
B[vi, vj] = B_local[vi, vj]
920922
921923
"""
922-
return _ffi_api.ScheduleCacheWrite(self, block, write_buffer_index, storage_scope) # type: ignore # pylint: disable=no-member
924+
return _ffi_api.ScheduleCacheWrite( # type: ignore # pylint: disable=no-member
925+
self, block, write_buffer_index, storage_scope
926+
)
923927

924928
########## Schedule: Compute location ##########
925929

src/tir/schedule/analysis/analysis.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ Buffer GetNthAccessBuffer(const ScheduleState& self, const Block& block, int n,
634634

635635
const Array<BufferRegion>& access_region = is_write ? block->writes : block->reads;
636636

637-
if (n < 0 || access_region.size() <= n) {
637+
if (n < 0 || static_cast<int>(access_region.size()) <= n) {
638638
throw BufferIndexOutOfRangeError(self->mod, block, n, is_write);
639639
}
640640
return access_region[n]->buffer;

src/tir/schedule/primitive/cache_read_write.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ SeqStmt InsertCacheStage(const Stmt& stmt, int pos, const Stmt& stage) {
185185
* \param self The state of the schedule
186186
* \param scope_sref The scope block where the write is considered
187187
* \param buffer The queried buffer
188-
* \return The sref of the only writer of the input buffer in the given scope, or `NullOpt` if no block writes it in the scope.
188+
* \return The sref of the only writer of the input buffer in the given scope,
189+
* or `NullOpt` if no block writes it in the scope.
189190
* \throw NotSingleWriteBlock if there are more than one intrested block.
190191
*/
191192
Optional<StmtSRef> GetOnlyWriteBlock(ScheduleState self, const StmtSRef& scope_sref,
@@ -239,11 +240,10 @@ BufferRegion RelaxBufferRegion(ScheduleState self, const BufferRegion& buffer_re
239240
class CacheLocDetector : public StmtVisitor {
240241
public:
241242
/*!
242-
* \brief Detect the insertion position of the cache stage, and write the position into the CacheStageInfo
243-
* \param self The state of the schedule
244-
* \param block_sref The sref of the unique writer block of the buffer being applied cache_read or cache_write
245-
* \param scope_sref The sref of the scope block of the cached block
246-
* \param info The cache stage info.
243+
* \brief Detect the insertion position of the cache stage, and write the position into the
244+
* CacheStageInfo \param self The state of the schedule \param block_sref The sref of the unique
245+
* writer block of the buffer being applied cache_read or cache_write \param scope_sref The sref
246+
* of the scope block of the cached block \param info The cache stage info.
247247
*/
248248
static void Detect(const ScheduleState& self, const StmtSRef& block_sref,
249249
const StmtSRef& scope_sref, CacheStageInfo* info) {
@@ -269,9 +269,9 @@ class CacheLocDetector : public StmtVisitor {
269269
/*!
270270
* \brief Constructor
271271
* \param self The state of the schedule
272-
* \param block_sref The sref of the unique writer block of the buffer being applied cache_read or cache_write
273-
* \param scope_sref The sref of the scope block of the cached block
274-
* \param related_blocks Producer blocks for cache_write, or consumer blocks for cache_read
272+
* \param block_sref The sref of the unique writer block of the buffer being applied cache_read or
273+
* cache_write \param scope_sref The sref of the scope block of the cached block \param
274+
* related_blocks Producer blocks for cache_write, or consumer blocks for cache_read
275275
*/
276276
CacheLocDetector(const ScheduleState self, const StmtSRef& block_sref, const StmtSRef& scope_sref,
277277
const std::vector<StmtSRef>& related_blocks)

src/tir/schedule/state.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,7 @@ TVM_DLL Array<Bool> GetCachedFlags(const ScheduleState& self, const StmtSRef& bl
10311031

10321032
TVM_DLL void ScheduleStateNode::UpdateAffineFlag(const StmtSRef& scope_sref) {
10331033
auto it = this->block_info.find(scope_sref);
1034-
ICHECK(it != this->block_info.end())
1035-
<< "Cannot find the block info of the given block.";
1034+
ICHECK(it != this->block_info.end()) << "Cannot find the block info of the given block.";
10361035
BlockInfo& info = it->second;
10371036

10381037
bool is_root_block = scope_sref->parent == nullptr;

0 commit comments

Comments
 (0)