We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents efa5f1d + e8a4a9b commit 2fca6eaCopy full SHA for 2fca6ea
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -287,6 +287,20 @@ struct OMPInformationCache : public InformationCache {
287
OpenMPPostLink(OpenMPPostLink) {
288
289
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
302
+ }
303
+
304
OMPBuilder.initialize();
305
initializeRuntimeFunctions(M);
306
initializeInternalControlVars();
0 commit comments