Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect spirv instruction OpAtomicFMaxEXT used in atomic_f_add #994

Closed
apriori opened this issue Feb 21, 2023 · 2 comments · Fixed by #995
Closed

Incorrect spirv instruction OpAtomicFMaxEXT used in atomic_f_add #994

apriori opened this issue Feb 21, 2023 · 2 comments · Fixed by #995

Comments

@apriori
Copy link

apriori commented Feb 21, 2023

pub unsafe fn atomic_f_add<F: Float, const SCOPE: u32, const SEMANTICS: u32>(
ptr: &mut F,
value: F,
) -> F {
let mut old = F::default();
asm! {
"%u32 = OpTypeInt 32 0",
"%scope = OpConstant %u32 {scope}",
"%semantics = OpConstant %u32 {semantics}",
"%value = OpLoad _ {value}",
"%old = OpAtomicFMaxEXT _ {ptr} %scope %semantics %value",

@LegNeato
Copy link
Contributor

Should that be OpAtomicFAddEXT?

@apriori
Copy link
Author

apriori commented Feb 26, 2023

Yes, it should. This seems to be a copy-and-paste error from a prior function definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants