MCPcopy Create free account
hub / github.com/Kitware/CMake / GenerateCudaDeviceLink

Method GenerateCudaDeviceLink

Source/cmFastbuildNormalTargetGenerator.cxx:1320–1354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1318}
1319
1320void cmFastbuildNormalTargetGenerator::GenerateCudaDeviceLink(
1321 FastbuildTarget& target) const
1322{
1323 auto const arches = this->GetArches();
1324 if (!requireDeviceLinking(*this->GeneratorTarget, *this->GetLocalGenerator(),
1325 Config)) {
1326 return;
1327 }
1328 LogMessage("GenerateCudaDeviceLink(...)");
1329 for (auto const& arch : arches) {
1330 std::string linker;
1331 std::string args;
1332 GetCudaDeviceLinkLinkerAndArgs(linker, args);
1333
1334 FastbuildLinkerNode deviceLinkNode;
1335 deviceLinkNode.Name = cmStrCat(target.Name, "_cuda_device_link");
1336 deviceLinkNode.Type = FastbuildLinkerNode::SHARED_LIBRARY;
1337 deviceLinkNode.Linker = std::move(linker);
1338 deviceLinkNode.LinkerOptions = std::move(args);
1339 // Output
1340 deviceLinkNode.LinkerOutput = this->ConvertToFastbuildPath(cmStrCat(
1341 FASTBUILD_DOLLAR_TAG "TargetOutDi"
1342 "r" FASTBUILD_DOLLAR_TAG "/cmake_device_link",
1343 (args.empty() ? "" : "_" + arch),
1344 this->Makefile->GetSafeDefinition("CMAKE_CUDA_OUTPUT_"
1345 "EXTENSION")));
1346
1347 // Input
1348 for (auto const& objList : target.ObjectListNodes) {
1349 deviceLinkNode.LibrarianAdditionalInputs.push_back(objList.Name);
1350 }
1351 target.CudaDeviceLinkNode.emplace_back(std::move(deviceLinkNode));
1352 }
1353 LogMessage("GenerateCudaDeviceLink end");
1354}
1355
1356void cmFastbuildNormalTargetGenerator::GenerateObjects(FastbuildTarget& target)
1357{

Callers

nothing calls this directly

Calls 9

GetArchesMethod · 0.95
requireDeviceLinkingFunction · 0.85
moveFunction · 0.85
push_backMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
GetLocalGeneratorMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected