Skip to content

Commit 2fca6ea

Browse files
authored
Merge pull request #17 from skatrak/atd/fix-opt-test
[OpenMP][LLVM] Fix opt test
2 parents efa5f1d + e8a4a9b commit 2fca6ea

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

llvm/lib/Transforms/IPO/OpenMPOpt.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,20 @@ struct OMPInformationCache : public InformationCache {
287287
OpenMPPostLink(OpenMPPostLink) {
288288

289289
OMPBuilder.Config.IsTargetDevice = isOpenMPDevice(OMPBuilder.M);
290+
const Triple T(OMPBuilder.M.getTargetTriple());
291+
switch (T.getArch()) {
292+
case llvm::Triple::nvptx:
293+
case llvm::Triple::nvptx64:
294+
case llvm::Triple::amdgcn:
295+
assert(OMPBuilder.Config.IsTargetDevice &&
296+
"OpenMP AMDGPU/NVPTX is only prepared to deal with device code.");
297+
OMPBuilder.Config.IsGPU = true;
298+
break;
299+
default:
300+
OMPBuilder.Config.IsGPU = false;
301+
break;
302+
}
303+
290304
OMPBuilder.initialize();
291305
initializeRuntimeFunctions(M);
292306
initializeInternalControlVars();

0 commit comments

Comments
 (0)