Skip to content

Commit 1fe96f8

Browse files
authored
Fix failures to handle increments of zero
1 parent f863895 commit 1fe96f8

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

kernel/riscv64/rot_vector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT
155155
}
156156
}else{
157157
gvl = VSETVL(n);
158+
if (inc_x == 0 && inc_y == 0) gvl = VSETVL(1);
158159
BLASLONG stride_x = inc_x * sizeof(FLOAT);
159160
BLASLONG stride_y = inc_y * sizeof(FLOAT);
160161
BLASLONG inc_xv = inc_x * gvl;

kernel/riscv64/swap_vector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT *x,
136136
}
137137
}else{
138138
gvl = VSETVL(n);
139+
if (inc_x == 0 && inc_y == 0) gvl = VSETVL(1);
139140
stride_x = inc_x * sizeof(FLOAT);
140141
stride_y = inc_y * sizeof(FLOAT);
141142
if(gvl <= n/2){

kernel/riscv64/zrot_vector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ int CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y, FLOAT
112112
}
113113

114114
}else{
115+
if (inc_x == 0 && inc_y == 0) gvl = VSETVL(1);
115116
for(i=0,j=0; i < n/gvl; i++){
116117
vx0 = VLSEV_FLOAT(&x[ix], stride_x, gvl);
117118
vx1 = VLSEV_FLOAT(&x[ix+1], stride_x, gvl);

kernel/riscv64/zswap_vector.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ int CNAME(BLASLONG n, BLASLONG dummy0, BLASLONG dummy1, FLOAT dummy3, FLOAT dumm
8181
}
8282
}else{
8383
gvl = VSETVL(n);
84+
if (inc_x == 0 && inc_y == 0) gvl = VSETVL(1);
8485
stride_x = inc_x * 2 * sizeof(FLOAT);
8586
stride_y = inc_y * 2 * sizeof(FLOAT);
8687
BLASLONG inc_xv = inc_x * gvl * 2;

0 commit comments

Comments
 (0)