[Openmp-commits] [PATCH] D106960: [OffloadArch] Library to query properties of current offload archicture

Yaxun Liu via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Aug 4 14:23:44 PDT 2021

yaxunl added a comment.

This only works on Linux. So either to make it work on both Linux and Windows, or restrict it to Linux in CMakeLists.txt, otherwise it breaks LLVM build on Windows.

Comment at: llvm/lib/OffloadArch/OffloadArch.cpp:17
+#include "llvm/Support/WithColor.h"
+#include <dirent.h>
+#include <fstream>
better to use LLVM or standard C++ functions for directory operations since dirent.h is not available in MSVC. Even though this utility only works on Linux for now, it is better to be platform-neutral to be ported to Windows.

Comment at: llvm/lib/OffloadArch/amdgpu/vendor_specific_capabilities.cpp:25
+#include "hsa-subset.h"
+#include <dlfcn.h>
It would be much simpler to use HIP API to get device name and capabilities e.g. gfx906:xnack+:sramecc-


It will work on both Linux and Windows. On Linux the availability of HIP runtime is the same as HSA runtime. On Windows HIP runtime is shipped with display driver, whereas HSA runtime is not available.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list