CPC G06F 17/16 (2013.01) [G06F 7/5443 (2013.01)] | 16 Claims |
1. A matrix calculation device, configured to perform a matrix multiplication of a first matrix multiplying a second matrix, the matrix calculation device comprising:
a storing unit, adapted to store the first matrix and the second matrix;
a multiply accumulate circuit, configured to execute multiply accumulate calculation;
a pre-fetch circuit, coupled to the storing unit, wherein the pre-fetch circuit pre-fetches at least one column of the first matrix from the storing unit to act as pre-fetch data, the pre-fetch circuit pre-fetches at least one row of the second matrix from the storing unit to act as the pre-fetch data, or the pre-fetch circuit pre-fetches at least one column of the first matrix and at least one row of the second matrix from the storing unit to act as the pre-fetch data; and
a control circuit, coupled to the storing unit, the multiply accumulate circuit, and the pre-fetch circuit, wherein the control circuit determines whether contents of a current column of the first matrix are all 0 according to the pre-fetch data, so as to decide whether to skip the multiply accumulate calculation performed on the current column and the current row, or
the control circuit determines whether contents of a current row of the second matrix are all 0 according to the pre-fetch data, so as to decide whether to skip the multiply accumulate calculation performed on the current column and the current row.
|