MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / alignTo

Method alignTo

lib/Bytecode/Writer/BytecodeWriter.cpp:143–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 uint64_t tell() const { return stream.tell(); }
142
143 void alignTo(uint64_t alignment,
144 uint8_t paddingByte = Bytecode::kAlignmentByte) {
145 if (alignment < 2)
146 return;
147 uint64_t currentPos = tell();
148 uint64_t padding = (alignment - (currentPos % alignment)) % alignment;
149 for (uint64_t i = 0; i < padding; ++i)
150 writeByte(paddingByte);
151 // Update the required alignment
152 requiredAlignment = std::max(requiredAlignment, alignment);
153 }
154 uint64_t getRequiredAlignment() const { return requiredAlignment; }
155
156private:

Callers 6

writeSectionHeaderFunction · 0.80
writeStringSectionMethod · 0.80
writeTypeSectionMethod · 0.80
writeConstantSectionMethod · 0.80
writeDebugInfoSectionMethod · 0.80

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected