Skip to content

Commit 915a6d6

Browse files
committed
Add casting.
1 parent 7ec3c16 commit 915a6d6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/power/sbgemv_common.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ FORCEINLINE void copy_x(BLASLONG n, IFLOAT *src, IFLOAT *dest, BLASLONG inc_src)
121121

122122
FORCEINLINE void copy_y_beta(BLASLONG n, FLOAT *src, FLOAT *dest, BLASLONG inc_src, FLOAT beta)
123123
{
124-
if (beta == 0) {
124+
if (beta == (FLOAT)0) {
125125
for (BLASLONG i = 0; i < n; i++) {
126126
*dest++ = (FLOAT)0;
127127
src += inc_src;
128128
}
129-
} else if (beta == 1) {
129+
} else if (beta == (FLOAT)1) {
130130
for (BLASLONG i = 0; i < n; i++) {
131131
*dest++ = *src;
132132
src += inc_src;
@@ -141,12 +141,12 @@ FORCEINLINE void copy_y_beta(BLASLONG n, FLOAT *src, FLOAT *dest, BLASLONG inc_s
141141

142142
FORCEINLINE void copy_y(BLASLONG n, FLOAT *src, FLOAT *dest, BLASLONG inc_src, FLOAT beta)
143143
{
144-
if (beta == 0) {
144+
if (beta == (FLOAT)0) {
145145
for (BLASLONG i = 0; i < n; i++) {
146146
*dest = *src++;
147147
dest += inc_src;
148148
}
149-
} else if (beta == 1) {
149+
} else if (beta == (FLOAT)1) {
150150
for (BLASLONG i = 0; i < n; i++) {
151151
*dest += *src++;
152152
dest += inc_src;
@@ -169,9 +169,9 @@ FORCEINLINE void move_y(BLASLONG n, FLOAT *src, FLOAT *dest, BLASLONG inc_dest)
169169

170170
static void BF16GEMV_N_beta(BLASLONG n, FLOAT *output_vector, FLOAT *input_vector, FLOAT beta)
171171
{
172-
if (beta == 0) {
172+
if (beta == (FLOAT)0) {
173173
memset(output_vector, 0, sizeof(FLOAT) * n);
174-
} else if (beta == 1) {
174+
} else if (beta == (FLOAT)1) {
175175
if (output_vector != input_vector) {
176176
memcpy(output_vector, input_vector, sizeof(FLOAT) * n);
177177
}

0 commit comments

Comments
 (0)