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

Method AddCUDAArchitectureFlags

Source/cmGeneratorTarget.cxx:2565–2599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2563}
2564
2565void cmGeneratorTarget::AddCUDAArchitectureFlags(cmBuildStep compileOrLink,
2566 std::string const& config,
2567 std::string& flags) const
2568{
2569 std::string arch = this->GetSafeProperty("CUDA_ARCHITECTURES");
2570
2571 if (arch.empty()) {
2572 switch (this->GetPolicyStatusCMP0104()) {
2573 case cmPolicies::WARN:
2574 if (!this->LocalGenerator->GetCMakeInstance()->GetIsInTryCompile()) {
2575 this->Makefile->IssueMessage(
2576 MessageType::AUTHOR_WARNING,
2577 cmPolicies::GetPolicyWarning(cmPolicies::CMP0104) +
2578 "\nCUDA_ARCHITECTURES is empty for target \"" + this->GetName() +
2579 "\".");
2580 }
2581 CM_FALLTHROUGH;
2582 case cmPolicies::OLD:
2583 break;
2584 default:
2585 this->Makefile->IssueMessage(
2586 MessageType::FATAL_ERROR,
2587 "CUDA_ARCHITECTURES is empty for target \"" + this->GetName() +
2588 "\".");
2589 }
2590 }
2591
2592 // If CUDA_ARCHITECTURES is false we don't add any architectures.
2593 if (cmIsOff(arch)) {
2594 return;
2595 }
2596
2597 this->AddCUDAArchitectureFlagsImpl(compileOrLink, config, "CUDA",
2598 std::move(arch), flags);
2599}
2600
2601void cmGeneratorTarget::AddCUDAArchitectureFlagsImpl(cmBuildStep compileOrLink,
2602 std::string const& config,

Callers 1

AddLanguageFlagsMethod · 0.80

Calls 8

cmIsOffFunction · 0.85
moveFunction · 0.85
GetIsInTryCompileMethod · 0.80
emptyMethod · 0.45
GetCMakeInstanceMethod · 0.45
IssueMessageMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected