MCPcopy Create free account
hub / github.com/KnowingNothing/MatmulTutorial / advance

Method advance

include/barrier.h:203–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 }
202
203 DEVICE PipelineState advance(uint32_t num_iterations) {
204 if constexpr (Stages > 0) {
205 // Number of iterations cross over the stage boundary => flipped phase
206 if ((num_iterations < Stages) && (index_ + num_iterations) >= Stages) {
207 phase_ ^= 1;
208 }
209 // How many times number of iterations cross over the stage boundary and
210 // end up on a odd number => flipped phase
211 if ((num_iterations >= Stages) &&
212 (((index_ + num_iterations) / Stages) % 2) == 1) {
213 phase_ ^= 1;
214 }
215 index_ = (index_ + num_iterations) % Stages;
216 count_ += num_iterations;
217 }
218 return *this;
219 }
220
221 DEVICE static PipelineState make_pipeline_state(PipelineState start_state,
222 uint32_t num_iterations) {

Callers 5

make_pipeline_stateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected