mod.rs.html -- source
Description: Source to the Rust file `src/libcore/../stdsimd/coresimd/nvptx/mod.rs`.
Keywords: rust, rustlang, rust-lang

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120

    //! NVPTX intrinsics (experimental)
    //!
    //! These intrinsics form the foundation of the CUDA
    //! programming model.
    //!
    //! The reference is the [CUDA C Programming Guide][cuda_c]. Relevant is also
    //! the [LLVM NVPTX Backend documentation][llvm_docs].
    //!
    //! [cuda_c]:
    //! http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html
    //! [llvm_docs]:
    //! https://llvm.org/docs/NVPTXUsage.html

    #[allow(improper_ctypes)]
    extern "C" {
        #[link_name = "llvm.cuda.syncthreads"]
        fn syncthreads() -> ();
        #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.x"]
        fn block_dim_x() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.y"]
        fn block_dim_y() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.ntid.z"]
        fn block_dim_z() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.x"]
        fn block_idx_x() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.y"]
        fn block_idx_y() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.ctaid.z"]
        fn block_idx_z() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.x"]
        fn grid_dim_x() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.y"]
        fn grid_dim_y() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.nctaid.z"]
        fn grid_dim_z() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.tid.x"]
        fn thread_idx_x() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.tid.y"]
        fn thread_idx_y() -> i32;
        #[link_name = "llvm.nvvm.read.ptx.sreg.tid.z"]
        fn thread_idx_z() -> i32;
    }

    /// Synchronizes all threads in the block.
    #[inline]
    pub unsafe fn _syncthreads() -> () {
        syncthreads()
    }

    /// x-th thread-block dimension.
    #[inline]
    pub unsafe fn _block_dim_x() -> i32 {
        block_dim_x()
    }

    /// y-th thread-block dimension.
    #[inline]
    pub unsafe fn _block_dim_y() -> i32 {
        block_dim_y()
    }

    /// z-th thread-block dimension.
    #[inline]
    pub unsafe fn _block_dim_z() -> i32 {
        block_dim_z()
    }

    /// x-th thread-block index.
    #[inline]
    pub unsafe fn _block_idx_x() -> i32 {
        block_idx_x()
    }

    /// y-th thread-block index.
    #[inline]
    pub unsafe fn _block_idx_y() -> i32 {
        block_idx_y()
    }

    /// z-th thread-block index.
    #[inline]
    pub unsafe fn _block_idx_z() -> i32 {
        block_idx_z()
    }

    /// x-th block-grid dimension.
    #[inline]
    pub unsafe fn _grid_dim_x() -> i32 {
        grid_dim_x()
    }

    /// y-th block-grid dimension.
    #[inline]
    pub unsafe fn _grid_dim_y() -> i32 {
        grid_dim_y()
    }

    /// z-th block-grid dimension.
    #[inline]
    pub unsafe fn _grid_dim_z() -> i32 {
        grid_dim_z()
    }

    /// x-th thread index.
    #[inline]
    pub unsafe fn _thread_idx_x() -> i32 {
        thread_idx_x()
    }

    /// y-th thread index.
    #[inline]
    pub unsafe fn _thread_idx_y() -> i32 {
        thread_idx_y()
    }

    /// z-th thread index.
    #[inline]
    pub unsafe fn _thread_idx_z() -> i32 {
        thread_idx_z()
    }

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)