lanl/singularity-eos

Consider replacing ternary expressions with multiplicative conditionals

開放

#319 建立於 2023年10月27日

 (2 則留言) (1 個反應) (0 位負責人)C++ (21 個分叉)auto 404
Performancegood first issue

倉庫指標

星標
 (36 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Per @Yurlungur we may want to replace

x = cond ? a : b

with

x = (cond) * a + (1 - cond) * b

to reduce branching and improve GPU performance.

This might be premature optimization, but it also might be a good way to specify default handling of NaNs as well.

貢獻者指南