Skip to content

Commit

Permalink
Optimize atomic float on NVPTX
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 23, 2023
1 parent fe84be8 commit 3778416
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn main() {
println!("cargo:rustc-cfg=portable_atomic_llvm15");
}
if !no_asm
&& (target_arch == "powerpc64" || target_arch == "s390x")
&& (target_arch == "powerpc64" || target_arch == "s390x" || target_arch == "nvptx64")
&& is_allowed_feature("asm_experimental_arch")
{
println!("cargo:rustc-cfg=portable_atomic_unstable_asm_experimental_arch");
Expand Down
10 changes: 10 additions & 0 deletions src/imp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ mod s390x;
#[cfg(target_arch = "msp430")]
pub(crate) mod msp430;

#[cfg(portable_atomic_unstable_asm_experimental_arch)]
#[cfg(feature = "float")]
#[cfg(target_arch = "nvptx64")]
pub(crate) mod nvptx;

#[cfg(any(test, not(feature = "critical-section")))]
#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_cas)))]
#[cfg_attr(
Expand Down Expand Up @@ -154,8 +159,13 @@ mod interrupt;
// Atomic float implementations

#[cfg(feature = "float")]
#[cfg(not(all(target_arch = "nvptx64", portable_atomic_unstable_asm_experimental_arch)))]
pub(crate) mod float;

#[cfg(feature = "float")]
#[cfg(all(target_arch = "nvptx64", portable_atomic_unstable_asm_experimental_arch))]
pub(crate) use nvptx as float;

// -----------------------------------------------------------------------------

// Atomic{Isize,Usize,Bool,Ptr}, Atomic{I,U}{8,16}
Expand Down
Loading

0 comments on commit 3778416

Please sign in to comment.