-
Notifications
You must be signed in to change notification settings - Fork 78
Description
this is basically a follow up to issue #382, where @nazar-pc said:
"""
Functions like workgroup_memory_barrier_with_group_sync() are unsafe, but it is not clear why (no "Safety" section in docs).
They should either not be unsafe or "Safety" section should be added to corresponding function docs explaining how to use them safely.
"""
Similar concern with the files in e.g. crates/spirv-std/src/arch/atomics.rs -- all of the atomic ops seem to be marked as unsafe. I don't understand the spir-v / Vulkan / whatevs memory model... like... at all... but I always thought atomic ops like these were specifically designed to provide a safe way to update memory that might be touched by multiple threads? If this is not the case, then as @nazar-pc suggested re barriers, a comment saying how to uphold any invariants required for safety would be a big help! Thanks!! :-)