brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · ad54755 Raw
39 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9/// \file10//11//===----------------------------------------------------------------------===//12 13#include "TargetInfo/AMDGPUTargetInfo.h"14#include "llvm/MC/TargetRegistry.h"15#include "llvm/Support/Compiler.h"16 17using namespace llvm;18 19/// The target for R600 GPUs.20Target &llvm::getTheR600Target() {21  static Target TheAMDGPUTarget;22  return TheAMDGPUTarget;23}24 25/// The target for GCN GPUs.26Target &llvm::getTheGCNTarget() {27  static Target TheGCNTarget;28  return TheGCNTarget;29}30 31/// Extern function to initialize the targets for the AMDGPU backend32extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void33LLVMInitializeAMDGPUTargetInfo() {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