Skip to content

Commit 338acb3

Browse files
committed
refactor: Use select instead of branch for softplus non-vec
Branch: ggml-cumsum-tri Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1 parent d006f35 commit 338acb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml-metal/ggml-metal.metal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ kernel void kernel_softplus_f32(
16161616
device float * dst,
16171617
uint tpig[[thread_position_in_grid]]) {
16181618
device const float & x = src0[tpig];
1619-
dst[tpig] = (x > 20.0f) ? x : log(1.0f + exp(x));
1619+
dst[tpig] = select(log(1.0f + exp(x)), x, x > 20.0f);
16201620
}
16211621

16221622
kernel void kernel_softplus_f32_4(

0 commit comments

Comments
 (0)