From ef717f385232562047acdc25ad355c3f29dfbe7d Mon Sep 17 00:00:00 2001 From: Atmn Patel Date: Tue, 9 Nov 2021 02:09:41 -0500 Subject: Revert "[clang][openmp][NFC] Remove arch-specific CGOpenMPRuntimeGPU files" This reverts commit 81a7cad2ffc18f15b732f69d991c8398c979c5ca. --- clang/lib/CodeGen/CodeGenModule.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index df5e02e9812f..3d11da295654 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -19,7 +19,8 @@ #include "CGObjCRuntime.h" #include "CGOpenCLRuntime.h" #include "CGOpenMPRuntime.h" -#include "CGOpenMPRuntimeGPU.h" +#include "CGOpenMPRuntimeAMDGCN.h" +#include "CGOpenMPRuntimeNVPTX.h" #include "CodeGenFunction.h" #include "CodeGenPGO.h" #include "ConstantEmitter.h" @@ -243,10 +244,14 @@ void CodeGenModule::createOpenMPRuntime() { switch (getTriple().getArch()) { case llvm::Triple::nvptx: case llvm::Triple::nvptx64: + assert(getLangOpts().OpenMPIsDevice && + "OpenMP NVPTX is only prepared to deal with device code."); + OpenMPRuntime.reset(new CGOpenMPRuntimeNVPTX(*this)); + break; case llvm::Triple::amdgcn: assert(getLangOpts().OpenMPIsDevice && - "OpenMP AMDGPU/NVPTX is only prepared to deal with device code."); - OpenMPRuntime.reset(new CGOpenMPRuntimeGPU(*this)); + "OpenMP AMDGCN is only prepared to deal with device code."); + OpenMPRuntime.reset(new CGOpenMPRuntimeAMDGCN(*this)); break; default: if (LangOpts.OpenMPSimd) -- cgit v1.2.3