Skip to content

Commit 77246e3

Browse files
committed
fix(cuda_std): use correct PTX scope suffix in atomic load/store
1 parent f76a232 commit 77246e3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

crates/cuda_std/src/atomic/intrinsics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ pub unsafe fn fence_acqrel_system() {
5252

5353
#[allow(unused_macros)]
5454
macro_rules! load_scope {
55-
(volatile, $scope:ident) => {
55+
(volatile, $scope_asm:ident) => {
5656
""
5757
};
58-
($ordering:ident, $scope:ident) => {
59-
concat!(".", stringify!($scope))
58+
($ordering:ident, $scope_asm:ident) => {
59+
concat!(".", stringify!($scope_asm))
6060
};
6161
}
6262

@@ -70,7 +70,7 @@ macro_rules! load {
7070
pub unsafe fn [<atomic_load_ $ordering _ $width _ $scope>](ptr: *const [<u $width>]) -> [<u $width>] {
7171
let mut out;
7272
asm!(
73-
concat!("ld.", stringify!($ordering), load_scope!($ordering, $scope), ".", stringify!([<u $width>]), " {}, [{}];"),
73+
concat!("ld.", stringify!($ordering), load_scope!($ordering, $scope_asm), ".", stringify!([<u $width>]), " {}, [{}];"),
7474
out([<reg $width>]) out,
7575
in(reg64) ptr
7676
);
@@ -116,7 +116,7 @@ macro_rules! store {
116116
#[doc = concat!("Performs a ", stringify!($ordering), " atomic store at the ", stringify!($scope), " level with a width of ", stringify!($width), " bits")]
117117
pub unsafe fn [<atomic_store_ $ordering _ $width _ $scope>](ptr: *mut [<u $width>], val: [<u $width>]) {
118118
asm!(
119-
concat!("st.", stringify!($ordering), load_scope!($ordering, $scope), ".", stringify!([<u $width>]), " [{}], {};"),
119+
concat!("st.", stringify!($ordering), load_scope!($ordering, $scope_asm), ".", stringify!([<u $width>]), " [{}], {};"),
120120
in(reg64) ptr,
121121
in([<reg $width>]) val,
122122
);

0 commit comments

Comments
 (0)