Skip to content

Commit

Permalink
Fix opt test
Browse files Browse the repository at this point in the history
  • Loading branch information
skatrak committed Jan 24, 2024
1 parent 31393ee commit e8a4a9b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,20 @@ struct OMPInformationCache : public InformationCache {
OpenMPPostLink(OpenMPPostLink) {

OMPBuilder.Config.IsTargetDevice = isOpenMPDevice(OMPBuilder.M);
const Triple T(OMPBuilder.M.getTargetTriple());
switch (T.getArch()) {
case llvm::Triple::nvptx:
case llvm::Triple::nvptx64:
case llvm::Triple::amdgcn:
assert(OMPBuilder.Config.IsTargetDevice &&
"OpenMP AMDGPU/NVPTX is only prepared to deal with device code.");
OMPBuilder.Config.IsGPU = true;
break;
default:
OMPBuilder.Config.IsGPU = false;
break;
}

OMPBuilder.initialize();
initializeRuntimeFunctions(M);
initializeInternalControlVars();
Expand Down

0 comments on commit e8a4a9b

Please sign in to comment.