Skip to content

Commit 0a079a9

Browse files
committed
Minor fix for the autogenerated kernels to work on intel CPUs
intel OpenCL driver does not support operations between unsigned int vectors and unsigned long scalars
1 parent 5ae0977 commit 0a079a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/library/blas/gens/fetch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ sprintfNormalizedBaseCoord(
359359
kstrcpy(kstr, name);
360360
}
361361
else {
362-
ksprintf(kstr, "(%s >> %d)", name, shift);
362+
ksprintf(kstr, "(uint)(%s >> %d)", name, shift);
363363
}
364364
}
365365

@@ -515,7 +515,7 @@ sprintfLeadingDimension(Kstring *ld, const FetchContext *fctx)
515515

516516
shift = findHighestSetBit(fctx->physTile.vecLen);
517517
if (shift != 0) {
518-
ksprintf(ld, "(%s >> %d)", varName, shift);
518+
ksprintf(ld, "(uint)(%s >> %d)", varName, shift);
519519
done = true;
520520
}
521521
}
@@ -564,10 +564,10 @@ sprintfGboundK(Kstring *kstr, const FetchContext *fctx)
564564
}
565565
else {
566566
if (fctx->addrMode & FETCH_ADDR_TAILK_PADD) {
567-
ksprintf(kstr, "((%s + %u) >> %d)", varK, vecLen - 1, shift);
567+
ksprintf(kstr, "(uint)((%s + %u) >> %d)", varK, vecLen - 1, shift);
568568
}
569569
else {
570-
ksprintf(kstr, "(%s >> %d)", varK, shift);
570+
ksprintf(kstr, "(uint)(%s >> %d)", varK, shift);
571571
}
572572
}
573573
}

0 commit comments

Comments
 (0)