Layout matrix correctly for additional rows
This commit is contained in:
@@ -46,12 +46,16 @@ pub const KERNEL: Kernel = Kernel([
|
||||
},
|
||||
Instruction::JUMP {
|
||||
offset: -1,
|
||||
count: 7,
|
||||
count: 15,
|
||||
},
|
||||
Instruction::FILL {
|
||||
src: File::GrfB { index: 0 },
|
||||
dst: File::Bank,
|
||||
},
|
||||
Instruction::FILL {
|
||||
src: File::GrfB { index: 1 },
|
||||
dst: File::Bank,
|
||||
},
|
||||
Instruction::EXIT,
|
||||
Instruction::NOP,
|
||||
Instruction::NOP,
|
||||
@@ -72,12 +76,11 @@ pub const KERNEL: Kernel = Kernel([
|
||||
Instruction::NOP,
|
||||
Instruction::NOP,
|
||||
Instruction::NOP,
|
||||
Instruction::NOP,
|
||||
]);
|
||||
|
||||
pub fn execute<const R: usize, const C: usize>(
|
||||
matrix: &Matrix<R, C>,
|
||||
input_vector: &interleaved_array::Vector<C>,
|
||||
pub fn execute<const X16R: usize, const R: usize, const X16C: usize>(
|
||||
matrix: &Matrix<X16R, X16C>,
|
||||
input_vector: &interleaved_array::Vector<X16C>,
|
||||
output_partial_sum_vector: &mut SVector<F16x16, R>,
|
||||
dummy: &impl PimOperand,
|
||||
) {
|
||||
@@ -85,11 +88,18 @@ pub fn execute<const R: usize, const C: usize>(
|
||||
block.execute_read();
|
||||
}
|
||||
|
||||
for column_block in matrix.0.fixed_rows::<1>(0).iter() {
|
||||
column_block.execute_read();
|
||||
for row_block in matrix.0.iter() {
|
||||
for column_block in row_block.fixed_rows::<1>(0).iter() {
|
||||
column_block.execute_read();
|
||||
}
|
||||
}
|
||||
|
||||
output_partial_sum_vector.execute_write();
|
||||
for chunk in output_partial_sum_vector
|
||||
.fixed_rows_with_step_mut::<X16R>(0, 16)
|
||||
.iter_mut()
|
||||
{
|
||||
chunk.execute_write();
|
||||
}
|
||||
|
||||
dummy.execute_read();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user