Skip to content

Commit 31efd0c

Browse files
authored
Update types.comp
1 parent 01c04c1 commit 31efd0c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

ggml/src/ggml-vulkan/vulkan-shaders/types.comp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,16 +1413,7 @@ float bf16_to_fp32(uint32_t u)
14131413
}
14141414

14151415
float e8m0_to_fp32(uint8_t x) {
1416-
// uint32_t bits;
1417-
1418-
// if (x == 0) {
1419-
// bits = 0x00400000;
1420-
// } else {
1421-
// bits = x;
1422-
// bits = bits << 23;
1423-
// }
1424-
1425-
// branchless optimization
1416+
// branchless implementation
14261417
uint is_zero = uint(x == 0);
14271418
uint result = (uint(x) << 23) | (is_zero << 22);
14281419
return uintBitsToFloat(result);

0 commit comments

Comments
 (0)