| 2758 | } |
| 2759 | |
| 2760 | void 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 | |
| 2796 | void cmGeneratorTarget::AddCUDAToolkitFlags(std::string& flags) const |
| 2797 | { |
no test coverage detected