|
@@ -1519,22 +1519,13 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
|
|
|
|
|
|
|
|
// Link device code for each architecture.
|
|
// Link device code for each architecture.
|
|
|
for (const std::string& architectureKind : architectures) {
|
|
for (const std::string& architectureKind : architectures) {
|
|
|
- // Clang always generates real code, so strip the specifier.
|
|
|
|
|
- const std::string architecture =
|
|
|
|
|
- architectureKind.substr(0, architectureKind.find('-'));
|
|
|
|
|
- const std::string cubin =
|
|
|
|
|
- cmStrCat(objectDir, "sm_", architecture, ".cubin");
|
|
|
|
|
-
|
|
|
|
|
- profiles += cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin);
|
|
|
|
|
- fatbinaryDepends.emplace_back(cubin);
|
|
|
|
|
-
|
|
|
|
|
std::string registerFileCmd;
|
|
std::string registerFileCmd;
|
|
|
|
|
|
|
|
// The generated register file contains macros that when expanded
|
|
// The generated register file contains macros that when expanded
|
|
|
// register the device routines. Because the routines are the same for
|
|
// register the device routines. Because the routines are the same for
|
|
|
// all architectures the register file will be the same too. Thus
|
|
// all architectures the register file will be the same too. Thus
|
|
|
// generate it only on the first invocation to reduce overhead.
|
|
// generate it only on the first invocation to reduce overhead.
|
|
|
- if (fatbinaryDepends.size() == 1) {
|
|
|
|
|
|
|
+ if (fatbinaryDepends.empty()) {
|
|
|
std::string const registerFileRel =
|
|
std::string const registerFileRel =
|
|
|
cmStrCat(relPath, relObjectDir, "cmake_cuda_register.h");
|
|
cmStrCat(relPath, relObjectDir, "cmake_cuda_register.h");
|
|
|
registerFileCmd =
|
|
registerFileCmd =
|
|
@@ -1542,6 +1533,15 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
|
|
|
cleanFiles.push_back(registerFileRel);
|
|
cleanFiles.push_back(registerFileRel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Clang always generates real code, so strip the specifier.
|
|
|
|
|
+ const std::string architecture =
|
|
|
|
|
+ architectureKind.substr(0, architectureKind.find('-'));
|
|
|
|
|
+ const std::string cubin =
|
|
|
|
|
+ cmStrCat(objectDir, "sm_", architecture, ".cubin");
|
|
|
|
|
+
|
|
|
|
|
+ profiles += cmStrCat(" -im=profile=sm_", architecture, ",file=", cubin);
|
|
|
|
|
+ fatbinaryDepends.emplace_back(cubin);
|
|
|
|
|
+
|
|
|
std::string command = cmStrCat(
|
|
std::string command = cmStrCat(
|
|
|
this->Makefile->GetRequiredDefinition("CMAKE_CUDA_DEVICE_LINKER"),
|
|
this->Makefile->GetRequiredDefinition("CMAKE_CUDA_DEVICE_LINKER"),
|
|
|
" -arch=sm_", architecture, registerFileCmd, " -o=$@ ",
|
|
" -arch=sm_", architecture, registerFileCmd, " -o=$@ ",
|