[DFAJumpThreading] Remove incoming StartBlock from all phis when unfolding select...
[llvm-project.git] / clang / tools / amdgpu-arch / AMDGPUArch.cpp
blob7ae57b7877e1feedc6270f922d7501aa5417015d
1 //===- AMDGPUArch.cpp - list AMDGPU installed ----------*- C++ -*---------===//
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 // This file implements a tool for detecting name of AMDGPU installed in system.
10 // This tool is used by AMDGPU OpenMP and HIP driver.
12 //===----------------------------------------------------------------------===//
14 #include "clang/Basic/Version.h"
15 #include "llvm/Support/CommandLine.h"
17 using namespace llvm;
19 static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden);
21 // Mark all our options with this category.
22 static cl::OptionCategory AMDGPUArchCategory("amdgpu-arch options");
24 static void PrintVersion(raw_ostream &OS) {
25 OS << clang::getClangToolFullVersion("amdgpu-arch") << '\n';
28 int printGPUsByHSA();
29 int printGPUsByHIP();
31 int main(int argc, char *argv[]) {
32 cl::HideUnrelatedOptions(AMDGPUArchCategory);
34 cl::SetVersionPrinter(PrintVersion);
35 cl::ParseCommandLineOptions(
36 argc, argv,
37 "A tool to detect the presence of AMDGPU devices on the system. \n\n"
38 "The tool will output each detected GPU architecture separated by a\n"
39 "newline character. If multiple GPUs of the same architecture are found\n"
40 "a string will be printed for each\n");
42 if (Help) {
43 cl::PrintHelpMessage();
44 return 0;
47 #ifndef _WIN32
48 if (!printGPUsByHSA())
49 return 0;
50 #endif
52 return printGPUsByHIP();