1 use crate::spec
::abi
::Abi
;
2 use crate::spec
::{LinkerFlavor, MergeFunctions, PanicStrategy, Target, TargetOptions}
;
4 pub fn target() -> Target
{
6 arch
: "nvptx64".to_string(),
7 data_layout
: "e-i64:64-i128:128-v16:16-v32:32-n16:32:64".to_string(),
8 llvm_target
: "nvptx64-nvidia-cuda".to_string(),
11 options
: TargetOptions
{
12 os
: "cuda".to_string(),
13 vendor
: "nvidia".to_string(),
14 linker_flavor
: LinkerFlavor
::PtxLinker
,
15 // The linker can be installed from `crates.io`.
16 linker
: Some("rust-ptx-linker".to_string()),
18 // With `ptx-linker` approach, it can be later overridden via link flags.
19 cpu
: "sm_30".to_string(),
21 // FIXME: create tests for the atomics.
22 max_atomic_width
: Some(64),
24 // Unwinding on CUDA is neither feasible nor useful.
25 panic_strategy
: PanicStrategy
::Abort
,
27 // Needed to use `dylib` and `bin` crate types and the linker.
28 dynamic_linking
: true,
31 // Avoid using dylib because it contain metadata not supported
32 // by LLVM NVPTX backend.
35 // Let the `ptx-linker` to handle LLVM lowering into MC / assembly.
38 // Convenient and predicable naming scheme.
39 dll_prefix
: "".to_string(),
40 dll_suffix
: ".ptx".to_string(),
41 exe_suffix
: ".ptx".to_string(),
43 // Disable MergeFunctions LLVM optimisation pass because it can
44 // produce kernel functions that call other kernel functions.
45 // This behavior is not supported by PTX ISA.
46 merge_functions
: MergeFunctions
::Disabled
,
48 // FIXME: enable compilation tests for the target and
49 // create the tests for this.
50 unsupported_abis
: vec
![