lanl/singularity-eos

Consider replacing ternary expressions with multiplicative conditionals

Open

#319 opened on Oct 27, 2023

View on GitHub
 (2 comments) (1 reaction) (0 assignees)C++ (21 forks)auto 404
Performancegood first issue

Repository metrics

Stars
 (36 stars)
PR merge metrics
 (PR metrics pending)

Description

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.

Contributor guide