[clang] [amdgpu-arch] Replace use of HSA with reading sysfs directly (PR #116651)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 18 08:49:56 PST 2024
================
@@ -0,0 +1,74 @@
+//===- AMDGPUArchByKFD.cpp - list AMDGPU installed ------*- C++ -*---------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements a tool for detecting name of AMD GPUs installed in
+// system using the Linux sysfs interface for the AMD KFD driver.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/LineIterator.h"
+#include "llvm/Support/MemoryBuffer.h"
+#include "llvm/Support/Path.h"
+#include <memory>
+#include <string>
+
+using namespace llvm;
+
+constexpr const char *KFD_SYSFS_NODE_PATH =
+ "/sys/devices/virtual/kfd/kfd/topology/nodes";
----------------
jhuber6 wrote:
As far as I can tell, it's hard coded in ROCt and I'd be shocked if it changed.
https://github.com/llvm/llvm-project/pull/116651
More information about the cfe-commits
mailing list