-
Notifications
You must be signed in to change notification settings - Fork 244
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
Add low-level atomic instructions to spirv_std::arch
#877
Conversation
crates/spirv-std/src/arch/atomic.rs
Outdated
#[spirv_std_macros::gpu_only] | ||
#[doc(alias = "OpAtomicFMinEXT")] | ||
#[inline] | ||
pub unsafe fn atomic_f_min_ext<F: Float, const SCOPE: u32, const SEMANTICS: u32>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just quicky skimming over this on my phone, but I think these would probably be fine with out the _ext
on the end of the function name. Everything else looks good though! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I removed the ext suffix 🙂
I saw that an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Eduard-Mihai Burtescu <edy.burt@gmail.com>
@BeastLe9enD I just tried pushing a commit fixing the test, but either the diff --git a/tests/ui/arch/debug_printf_type_checking.stderr b/tests/ui/arch/debug_printf_type_checking.stderr
index f719d0aba..d422023e6 100644
--- a/tests/ui/arch/debug_printf_type_checking.stderr
+++ b/tests/ui/arch/debug_printf_type_checking.stderr
@@ -100,9 +100,9 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2_usize>` is not satisfied
<IVec3 as Vector<i32, 3_usize>>
and 9 others
note: required by a bound in `debug_printf_assert_is_vector`
- --> $SPIRV_STD_SRC/lib.rs:144:8
+ --> $SPIRV_STD_SRC/lib.rs:145:8
|
-144 | V: crate::vector::Vector<TY, SIZE>,
+145 | V: crate::vector::Vector<TY, SIZE>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector`
error[E0308]: mismatched types (line numbers in Or Sorry this fell through the cracks, |
Head branch was pushed to by a user without write access
Hey, I added some atomic instructions to
spirv_std::arch
.There was already a discussion to add them, but it wasn't done at the time because the idea was to implement atomic using
core::sync::atomic
(see #442).But I think it's ok to add the intrinsics in advance and then build the API on top of them later 🙂