Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/Driver.cpp
Show First 20 Lines • Show All 866 Lines • ▼ Show 20 Lines | if (Arg *OpenMPTargets = | ||||
auto TempTC = std::make_unique<toolchains::CudaToolChain>( | auto TempTC = std::make_unique<toolchains::CudaToolChain>( | ||||
*this, *NVPTXTriple, *HostTC, C.getInputArgs()); | *this, *NVPTXTriple, *HostTC, C.getInputArgs()); | ||||
for (StringRef Arch : getOffloadArchs( | for (StringRef Arch : getOffloadArchs( | ||||
C, C.getArgs(), Action::OFK_OpenMP, &*TempTC, true)) | C, C.getArgs(), Action::OFK_OpenMP, &*TempTC, true)) | ||||
Archs.insert(Arch); | Archs.insert(Arch); | ||||
} | } | ||||
if (AMDTriple) { | if (AMDTriple) { | ||||
auto TempTC = std::make_unique<toolchains::AMDGPUOpenMPToolChain>( | auto TempTC = std::make_unique<toolchains::AMDGPUOpenMPToolChain>( | ||||
*this, *AMDTriple, *HostTC, C.getInputArgs()); | *this, *AMDTriple, *HostTC, C.getInputArgs(), C.getArgs()); | ||||
for (StringRef Arch : getOffloadArchs( | for (StringRef Arch : getOffloadArchs( | ||||
C, C.getArgs(), Action::OFK_OpenMP, &*TempTC, true)) | C, C.getArgs(), Action::OFK_OpenMP, &*TempTC, true)) | ||||
Archs.insert(Arch); | Archs.insert(Arch); | ||||
} | } | ||||
if (!AMDTriple && !NVPTXTriple) { | if (!AMDTriple && !NVPTXTriple) { | ||||
for (StringRef Arch : | for (StringRef Arch : | ||||
getOffloadArchs(C, C.getArgs(), Action::OFK_OpenMP, nullptr, true)) | getOffloadArchs(C, C.getArgs(), Action::OFK_OpenMP, nullptr, true)) | ||||
Archs.insert(Arch); | Archs.insert(Arch); | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | for (StringRef Val : OpenMPTriples) { | ||||
auto &DeviceTC = | auto &DeviceTC = | ||||
ToolChains[TT.str() + "/" + HostTC->getTriple().normalize()]; | ToolChains[TT.str() + "/" + HostTC->getTriple().normalize()]; | ||||
if (!DeviceTC) { | if (!DeviceTC) { | ||||
if (TT.isNVPTX()) | if (TT.isNVPTX()) | ||||
DeviceTC = std::make_unique<toolchains::CudaToolChain>( | DeviceTC = std::make_unique<toolchains::CudaToolChain>( | ||||
*this, TT, *HostTC, C.getInputArgs()); | *this, TT, *HostTC, C.getInputArgs()); | ||||
else if (TT.isAMDGCN()) | else if (TT.isAMDGCN()) | ||||
DeviceTC = std::make_unique<toolchains::AMDGPUOpenMPToolChain>( | DeviceTC = std::make_unique<toolchains::AMDGPUOpenMPToolChain>( | ||||
*this, TT, *HostTC, C.getInputArgs()); | *this, TT, *HostTC, C.getInputArgs(), C.getArgs()); | ||||
else | else | ||||
assert(DeviceTC && "Device toolchain not defined."); | assert(DeviceTC && "Device toolchain not defined."); | ||||
} | } | ||||
TC = DeviceTC.get(); | TC = DeviceTC.get(); | ||||
} else | } else | ||||
TC = &getToolChain(C.getInputArgs(), TT); | TC = &getToolChain(C.getInputArgs(), TT); | ||||
C.addOffloadDeviceToolChain(TC, Action::OFK_OpenMP); | C.addOffloadDeviceToolChain(TC, Action::OFK_OpenMP); | ||||
▲ Show 20 Lines • Show All 5,437 Lines • Show Last 20 Lines |