mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
CUDA: Clang separable compilation
For NVCC the compiler takes care of device linking when passed the "-dlink"
flag.
Clang doesn't support such magic and requires the buildsystem to do the work
that NVCC does behind the scenes.
The implementation is based on Bazel's device linking documentation:
7cabcdf073/third_party/nccl/build_defs.bzl.tpl (L259)
Closes: #20726
This commit is contained in:
@@ -21,18 +21,31 @@ public:
|
||||
private:
|
||||
std::string LanguageLinkerRule(const std::string& config) const;
|
||||
std::string LanguageLinkerDeviceRule(const std::string& config) const;
|
||||
std::string LanguageLinkerCudaDeviceRule(const std::string& config) const;
|
||||
std::string LanguageLinkerCudaDeviceCompileRule(
|
||||
const std::string& config) const;
|
||||
std::string LanguageLinkerCudaFatbinaryRule(const std::string& config) const;
|
||||
|
||||
const char* GetVisibleTypeName() const;
|
||||
void WriteLanguagesRules(const std::string& config);
|
||||
|
||||
void WriteLinkRule(bool useResponseFile, const std::string& config);
|
||||
void WriteDeviceLinkRule(bool useResponseFile, const std::string& config);
|
||||
void WriteDeviceLinkRules(const std::string& config);
|
||||
void WriteNvidiaDeviceLinkRule(bool useResponseFile,
|
||||
const std::string& config);
|
||||
|
||||
void WriteLinkStatement(const std::string& config,
|
||||
const std::string& fileConfig, bool firstForConfig);
|
||||
void WriteDeviceLinkStatement(const std::string& config,
|
||||
const std::string& fileConfig,
|
||||
bool firstForConfig);
|
||||
void WriteDeviceLinkStatements(const std::string& config,
|
||||
const std::vector<std::string>& architectures,
|
||||
const std::string& output);
|
||||
void WriteNvidiaDeviceLinkStatement(const std::string& config,
|
||||
const std::string& fileConfig,
|
||||
const std::string& outputDir,
|
||||
const std::string& output);
|
||||
|
||||
void WriteObjectLibStatement(const std::string& config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user