Clearer code following code review.
This commit is contained in:
parent
7f3d24f6b0
commit
eacb0742a9
@ -1956,12 +1956,10 @@ static void EmitTile(
|
|||||||
IrArray::Index source_idx = tile_origin_index.AddOffsetToDim(
|
IrArray::Index source_idx = tile_origin_index.AddOffsetToDim(
|
||||||
start_offset_x, KernelMappingScheme::DimX, b);
|
start_offset_x, KernelMappingScheme::DimX, b);
|
||||||
|
|
||||||
// True when we all threads will always completly unroll.
|
// True when all threads will always execute all instructions.
|
||||||
// So we do not need to emit condition.
|
// So we do not need to emit condition.
|
||||||
bool always_full_unroll = false;
|
bool always_full_tile =
|
||||||
if (mapping_scheme.GetDimsInElems()[2] % tile_size_x == 0){
|
mapping_scheme.GetDimsInElems()[2] % tile_size_x == 0;
|
||||||
always_full_unroll = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ksl->For(
|
ksl->For(
|
||||||
loop_name + "_y_in_tile",
|
loop_name + "_y_in_tile",
|
||||||
@ -1977,7 +1975,7 @@ static void EmitTile(
|
|||||||
constant(j * step_x), KernelMappingScheme::DimX, b);
|
constant(j * step_x), KernelMappingScheme::DimX, b);
|
||||||
// The if-statement below always evaluates to true for the blocks
|
// The if-statement below always evaluates to true for the blocks
|
||||||
// where the entire processed tile fits within the input buffer.
|
// where the entire processed tile fits within the input buffer.
|
||||||
if (!always_full_unroll) {
|
if (!always_full_tile) {
|
||||||
ksl->If(loop_name + "_x_in_tile", b->CreateICmpULT(x_loc, tile_width),
|
ksl->If(loop_name + "_x_in_tile", b->CreateICmpULT(x_loc, tile_width),
|
||||||
[&] { emit_elem_function(source_idx_x, y_loc, x_loc, j); });
|
[&] { emit_elem_function(source_idx_x, y_loc, x_loc, j); });
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user