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

Method AddHIPArchitectureFlags

Source/cmGeneratorTarget.cxx:2760–2794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2758}
2759
2760void cmGeneratorTarget::AddHIPArchitectureFlags(cmBuildStep compileOrLink,
2761 std::string const& config,
2762 std::string& flags) const
2763{
2764 std::string arch = this->GetSafeProperty("HIP_ARCHITECTURES");
2765
2766 if (arch.empty()) {
2767 this->Makefile->IssueMessage(
2768 MessageType::FATAL_ERROR,
2769 cmStrCat("HIP_ARCHITECTURES is empty for target \"", this->GetName(),
2770 "\"."));
2771 }
2772
2773 // If HIP_ARCHITECTURES is false we don't add any architectures.
2774 if (cmIsOff(arch)) {
2775 return;
2776 }
2777
2778 if (this->Makefile->GetSafeDefinition("CMAKE_HIP_PLATFORM") == "nvidia") {
2779 this->AddCUDAArchitectureFlagsImpl(compileOrLink, config, "HIP",
2780 std::move(arch), flags);
2781 return;
2782 }
2783
2784 // For spirv platform, chipStar handles targeting via the hip package
2785 if (this->Makefile->GetSafeDefinition("CMAKE_HIP_PLATFORM") == "spirv") {
2786 return;
2787 }
2788
2789 cmList options(arch);
2790
2791 for (std::string& option : options) {
2792 flags += " --offload-arch=" + option;
2793 }
2794}
2795
2796void cmGeneratorTarget::AddCUDAToolkitFlags(std::string& flags) const
2797{

Callers 1

AddLanguageFlagsMethod · 0.80

Calls 7

cmIsOffFunction · 0.85
moveFunction · 0.85
cmStrCatFunction · 0.70
emptyMethod · 0.45
IssueMessageMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected