diff options
author | root <raul@tambre.ee> | 2021-07-27 20:38:36 (GMT) |
---|---|---|
committer | root <raul@tambre.ee> | 2021-07-29 10:19:37 (GMT) |
commit | 3975678fcc3928f2a7dcd79fe9b9e9ebf3abe2b2 (patch) | |
tree | d05cd8b351a616278cc788cb06af35186f819693 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 0b1cea66cd1f80458f0da579d0182d908874939d (diff) | |
download | CMake-3975678fcc3928f2a7dcd79fe9b9e9ebf3abe2b2.zip CMake-3975678fcc3928f2a7dcd79fe9b9e9ebf3abe2b2.tar.gz CMake-3975678fcc3928f2a7dcd79fe9b9e9ebf3abe2b2.tar.bz2 |
CUDA/Clang: Simplify --register-link-binaries logic
Move the logic for appending cubin afterwards, so the check can simply be
empty().
With the Makefile generator the option is now at the front instead of being
intermixed with the actual bins.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 5a4c652..493bd4a 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -753,10 +753,6 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements( const std::string cubin = cmStrCat(ninjaOutputDir, "/sm_", architecture, ".cubin"); - fatbinary.Variables["PROFILES"] += - cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin); - fatbinary.ExplicitDeps.emplace_back(cubin); - cmNinjaBuild dlink(this->LanguageLinkerCudaDeviceRule(config)); dlink.ExplicitDeps = explicitDeps; dlink.Outputs = { cubin }; @@ -766,11 +762,15 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatements( // the device routines. Because the routines are the same for all // architectures the register file will be the same too. Thus generate it // only on the first invocation to reduce overhead. - if (fatbinary.ExplicitDeps.size() == 1) { + if (fatbinary.ExplicitDeps.empty()) { dlink.Variables["REGISTER"] = cmStrCat( "--register-link-binaries=", ninjaOutputDir, "/cmake_cuda_register.h"); } + fatbinary.Variables["PROFILES"] += + cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin); + fatbinary.ExplicitDeps.emplace_back(cubin); + this->GetGlobalGenerator()->WriteBuild(this->GetCommonFileStream(), dlink); } |