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 Oct 20, 2022
1 parent 83b980c commit 49a4c61
Show file tree
Hide file tree
Showing 5 changed files with 417 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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_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 @@ -65,6 +65,11 @@ mod s390x;
#[cfg(target_arch = "msp430")]
pub(crate) mod msp430;

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

#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_cas)))]
#[cfg_attr(
not(portable_atomic_no_cfg_target_has_atomic),
Expand Down Expand Up @@ -136,8 +141,13 @@ mod interrupt;
// Atomic float implementations

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

#[cfg(feature = "float")]
#[cfg(all(target_arch = "nvptx64", portable_atomic_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 49a4c61

Please sign in to comment.