janniklinde commented on code in PR #2376:
URL: https://github.com/apache/systemds/pull/2376#discussion_r2610333818


##########
src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixReorg.java:
##########
@@ -514,6 +516,119 @@ public static MatrixBlock roll(MatrixBlock in, 
MatrixBlock out, int shift) {
                return out;
        }
 
+       public static MatrixBlock roll(MatrixBlock input, MatrixBlock output, 
int shift, int numThreads) {
+
+               final int numRows = input.rlen;
+               final int numCols = input.clen;
+               final boolean isSparse = input.sparse;
+
+               // sparse-safe operation
+               if(input.isEmptyBlock(false))
+                       return output;
+
+               // special case: row vector
+               if(numRows == 1) {
+                       output.copy(input);
+                       return output;
+               }
+
+               if(numThreads <= 1 || input.isEmptyBlock(false) || 
input.getLength() < PAR_NUMCELL_THRESHOLD) {

Review Comment:
   `input.isEmptyBlock(false)` check is unnecessary (duplicate)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to