[Openmp-commits] [openmp] [OpenMP][libomptarget] Enable automatic unified shared memory executi… (PR #75999)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 19 19:47:25 PST 2023


================
@@ -3109,6 +3126,47 @@ struct AMDGPUPluginTy final : public GenericPluginTy {
     return HSA_STATUS_ERROR;
   }
 
+  /// Detect if current architecture is an APU.
+  void isAPU() {
+    char GfxName[64];
+
+    if (!KernelAgents.size())
+      return;
+
+    // Do not allow for mixed APU+discrete GPU combinations: an APU can only be
+    // that, so only check the first GPU agent.
+    hsa_agent_t GPUAgent = KernelAgents[0];
+    std::memset((void *)&GfxName, 0, sizeof(char) * 64);
+
+    hsa_status_t Status = hsa_agent_get_info(
+        GPUAgent, (hsa_agent_info_t)HSA_AGENT_INFO_NAME, GfxName);
----------------
jdoerfert wrote:

This is already available in ComputeUnitKind

https://github.com/llvm/llvm-project/pull/75999


More information about the Openmp-commits mailing list