SWDEV-371628 Use integrated Comgr action to link ROCm device libs

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: Ie0bbee7d9a12672536b6d751056a941128ed58be
This commit is contained in:
Jacob Lambert
2023-11-09 13:17:06 -08:00
committed by Jacob Lambert
parent 14bcbcc25b
commit 6311ed8a8e
2 changed files with 16 additions and 29 deletions
+3 -3
View File
@@ -460,13 +460,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,