SWDEV-371628 - Shift device lib linking into clang driver

Previously, we used the following approach and Comgr actions
for device lib linking:

    AMD_COMGR_COMPILE_SOURCE_TO_BC (compile with clang driver)
    AMD_COMGR_ADD_DEVICE_LIBRARIES (link in device libs with
      llvm-link API)

However, the clang driver can link in device libraries as part
of compilation, assuming a --rocm-path is set. In this context,
this is accomplished by using the following Comgr action instead:

  AMD_COMGR_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC (compile and
    link in device libs with clang driver)

Change-Id: I661465865365afecc44aa15d4df91bfab361af8d


[ROCm/clr commit: a4c5c44008]
This commit is contained in:
Jacob Lambert
2023-04-13 16:25:13 -07:00
committed by Jacob Lambert
parent 915677e9a0
commit 2e664d2492
2 changed files with 21 additions and 31 deletions
+3 -3
View File
@@ -457,13 +457,13 @@ class Program : public amd::HeapObject {
bool linkLLVMBitcode(const amd_comgr_data_set_t inputs,
const std::vector<std::string>& options,
amd::option::Options* amdOptions, amd_comgr_data_set_t* output,
char* binaryData[] = nullptr, size_t* binarySize = nullptr,
const bool link_dev_libs = true);
char* binaryData[] = nullptr, size_t* binarySize = nullptr);
//! Create the bitcode of the compiled input dataset
bool compileToLLVMBitcode(const amd_comgr_data_set_t compileInputs,
const std::vector<std::string>& options, amd::option::Options* amdOptions,
char* binaryData[], size_t* binarySize);
char* binaryData[], size_t* binarySize,
const bool link_dev_libs = true);
//! Compile and create the excutable of the input dataset
bool compileAndLinkExecutable(const amd_comgr_data_set_t inputs,