1 | //===-- TargetInfo/AMDGPUTargetInfo.cpp - TargetInfo for AMDGPU -----------===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | /// \file |
10 | // |
11 | //===----------------------------------------------------------------------===// |
12 | |
13 | #include "TargetInfo/AMDGPUTargetInfo.h" |
14 | #include "llvm/MC/TargetRegistry.h" |
15 | #include "llvm/Support/Compiler.h" |
16 | |
17 | using namespace llvm; |
18 | |
19 | /// The target for R600 GPUs. |
20 | Target &llvm::getTheR600Target() { |
21 | static Target TheAMDGPUTarget; |
22 | return TheAMDGPUTarget; |
23 | } |
24 | |
25 | /// The target for GCN GPUs. |
26 | Target &llvm::getTheGCNTarget() { |
27 | static Target TheGCNTarget; |
28 | return TheGCNTarget; |
29 | } |
30 | |
31 | /// Extern function to initialize the targets for the AMDGPU backend |
32 | extern "C"LLVM_ABI LLVM_EXTERNAL_VISIBILITY void |
33 | LLVMInitializeAMDGPUTargetInfo() { |
34 | RegisterTarget<Triple::r600, false> R600(getTheR600Target(), "r600", |
35 | "AMD GPUs HD2XXX-HD6XXX", "AMDGPU"); |
36 | RegisterTarget<Triple::amdgcn, false> GCN(getTheGCNTarget(), "amdgcn", |
37 | "AMD GCN GPUs", "AMDGPU"); |
38 | } |
39 |