From 77246e39dd36bf02ddfaab3aa18ca5ef55b8f523 Mon Sep 17 00:00:00 2001 From: Snehal Reddy Date: Sun, 8 Feb 2026 15:49:02 +0000 Subject: [PATCH] fix(cuda_std): use correct PTX scope suffix in atomic load/store --- crates/cuda_std/src/atomic/intrinsics.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/cuda_std/src/atomic/intrinsics.rs b/crates/cuda_std/src/atomic/intrinsics.rs index 7a48d5f4..1da0c68b 100644 --- a/crates/cuda_std/src/atomic/intrinsics.rs +++ b/crates/cuda_std/src/atomic/intrinsics.rs @@ -52,11 +52,11 @@ pub unsafe fn fence_acqrel_system() { #[allow(unused_macros)] macro_rules! load_scope { - (volatile, $scope:ident) => { + (volatile, $scope_asm:ident) => { "" }; - ($ordering:ident, $scope:ident) => { - concat!(".", stringify!($scope)) + ($ordering:ident, $scope_asm:ident) => { + concat!(".", stringify!($scope_asm)) }; } @@ -70,7 +70,7 @@ macro_rules! load { pub unsafe fn [](ptr: *const []) -> [] { let mut out; asm!( - concat!("ld.", stringify!($ordering), load_scope!($ordering, $scope), ".", stringify!([]), " {}, [{}];"), + concat!("ld.", stringify!($ordering), load_scope!($ordering, $scope_asm), ".", stringify!([]), " {}, [{}];"), out([]) out, in(reg64) ptr ); @@ -116,7 +116,7 @@ macro_rules! store { #[doc = concat!("Performs a ", stringify!($ordering), " atomic store at the ", stringify!($scope), " level with a width of ", stringify!($width), " bits")] pub unsafe fn [](ptr: *mut [], val: []) { asm!( - concat!("st.", stringify!($ordering), load_scope!($ordering, $scope), ".", stringify!([]), " [{}], {};"), + concat!("st.", stringify!($ordering), load_scope!($ordering, $scope_asm), ".", stringify!([]), " [{}], {};"), in(reg64) ptr, in([]) val, );