|
| 1 | +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution and at |
| 3 | +// http://rust-lang.org/COPYRIGHT. |
| 4 | +// |
| 5 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | +// option. This file may not be copied, modified, or distributed |
| 9 | +// except according to those terms. |
| 10 | + |
| 11 | +// DO NOT EDIT: autogenerated by etc/platform-intrinsics/generator.py |
| 12 | +// ignore-tidy-linelength |
| 13 | + |
| 14 | +#![allow(unused_imports)] |
| 15 | + |
| 16 | +use {Intrinsic, Type}; |
| 17 | +use IntrinsicDef::Named; |
| 18 | + |
| 19 | +// The default inlining settings trigger a pathological behaviour in |
| 20 | +// LLVM, which causes makes compilation very slow. See #28273. |
| 21 | +#[inline(never)] |
| 22 | +pub fn find(name: &str) -> Option<Intrinsic> { |
| 23 | + if !name.starts_with("nvptx") { return None } |
| 24 | + Some(match &name["nvptx".len()..] { |
| 25 | + "_syncthreads" => Intrinsic { |
| 26 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 27 | + output: &::VOID, |
| 28 | + definition: Named("llvm.cuda.syncthreads") |
| 29 | + }, |
| 30 | + "_block_dim_x" => Intrinsic { |
| 31 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 32 | + output: &::I32, |
| 33 | + definition: Named("llvm.nvvm.read.ptx.sreg.ntid.x") |
| 34 | + }, |
| 35 | + "_block_dim_y" => Intrinsic { |
| 36 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 37 | + output: &::I32, |
| 38 | + definition: Named("llvm.nvvm.read.ptx.sreg.ntid.y") |
| 39 | + }, |
| 40 | + "_block_dim_z" => Intrinsic { |
| 41 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 42 | + output: &::I32, |
| 43 | + definition: Named("llvm.nvvm.read.ptx.sreg.ntid.z") |
| 44 | + }, |
| 45 | + "_block_idx_x" => Intrinsic { |
| 46 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 47 | + output: &::I32, |
| 48 | + definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.x") |
| 49 | + }, |
| 50 | + "_block_idx_y" => Intrinsic { |
| 51 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 52 | + output: &::I32, |
| 53 | + definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.y") |
| 54 | + }, |
| 55 | + "_block_idx_z" => Intrinsic { |
| 56 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 57 | + output: &::I32, |
| 58 | + definition: Named("llvm.nvvm.read.ptx.sreg.ctaid.z") |
| 59 | + }, |
| 60 | + "_grid_dim_x" => Intrinsic { |
| 61 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 62 | + output: &::I32, |
| 63 | + definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.x") |
| 64 | + }, |
| 65 | + "_grid_dim_y" => Intrinsic { |
| 66 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 67 | + output: &::I32, |
| 68 | + definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.y") |
| 69 | + }, |
| 70 | + "_grid_dim_z" => Intrinsic { |
| 71 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 72 | + output: &::I32, |
| 73 | + definition: Named("llvm.nvvm.read.ptx.sreg.nctaid.z") |
| 74 | + }, |
| 75 | + "_thread_idx_x" => Intrinsic { |
| 76 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 77 | + output: &::I32, |
| 78 | + definition: Named("llvm.nvvm.read.ptx.sreg.tid.x") |
| 79 | + }, |
| 80 | + "_thread_idx_y" => Intrinsic { |
| 81 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 82 | + output: &::I32, |
| 83 | + definition: Named("llvm.nvvm.read.ptx.sreg.tid.y") |
| 84 | + }, |
| 85 | + "_thread_idx_z" => Intrinsic { |
| 86 | + inputs: { static INPUTS: [&'static Type; 0] = []; &INPUTS }, |
| 87 | + output: &::I32, |
| 88 | + definition: Named("llvm.nvvm.read.ptx.sreg.tid.z") |
| 89 | + }, |
| 90 | + _ => return None, |
| 91 | + }) |
| 92 | +} |
0 commit comments