lanl/singularity-eos

Consider replacing ternary expressions with multiplicative conditionals

Aperta

#319 aperta il 27 ott 2023

 (2 commenti) (1 reazione) (0 assegnatari)C++ (21 fork)auto 404
Performancegood first issue

Metriche repository

Star
 (36 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor