SWDEV-340226 - SWDEV-340692 - Fix minor issues with hiprtc Link APIs
- hiprtcAddLinkData should accept 0 or null as input name - hiprtcLinkCreate should accept 0 or null as options ptr - hiprtcCompile should send -fgpu-rdc option to comgr if its present in the options Change-Id: I84f6e36df5c99b719ee9c67dfc1b4dbcfd8e3172
Bu işleme şunda yer alıyor:
@@ -112,11 +112,10 @@ hiprtcResult hiprtcCompileProgram(hiprtcProgram prog, int numOptions, const char
|
||||
std::vector<std::string> opt;
|
||||
opt.reserve(numOptions);
|
||||
for (int i = 0; i < numOptions; i++) {
|
||||
if(std::string(options[i]) == std::string("-fgpu-rdc")) {
|
||||
if (std::string(options[i]) == std::string("-fgpu-rdc")) {
|
||||
fgpu_rdc = true;
|
||||
} else {
|
||||
opt.push_back(std::string(options[i]));
|
||||
}
|
||||
opt.push_back(std::string(options[i]));
|
||||
}
|
||||
|
||||
if (!rtcProgram->compile(opt, fgpu_rdc)) {
|
||||
@@ -317,9 +316,14 @@ hiprtcResult hiprtcLinkAddData(hiprtcLinkState hip_link_state, hiprtcJITInputTyp
|
||||
HIPRTC_RETURN(HIPRTC_ERROR_INVALID_INPUT);
|
||||
}
|
||||
|
||||
std::string input_name;
|
||||
if (name) {
|
||||
input_name = name;
|
||||
}
|
||||
|
||||
hiprtc::RTCLinkProgram* rtc_link_prog_ptr
|
||||
= reinterpret_cast<hiprtc::RTCLinkProgram*>(hip_link_state);
|
||||
if (!rtc_link_prog_ptr->AddLinkerData(image, image_size, name, input_type)) {
|
||||
if (!rtc_link_prog_ptr->AddLinkerData(image, image_size, input_name, input_type)) {
|
||||
HIPRTC_RETURN(HIPRTC_ERROR_PROGRAM_CREATION_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
@@ -380,11 +380,6 @@ RTCLinkProgram::RTCLinkProgram(std::string name) : RTCProgram(name) {
|
||||
bool RTCLinkProgram::AddLinkerOptions(unsigned int num_options, hiprtcJIT_option* options_ptr,
|
||||
void** options_vals_ptr) {
|
||||
|
||||
if (options_ptr == nullptr || options_vals_ptr == nullptr) {
|
||||
crashWithMessage("JIT Options ptr cannot be null");
|
||||
return false;
|
||||
}
|
||||
|
||||
for (size_t opt_idx = 0; opt_idx < num_options; ++opt_idx) {
|
||||
|
||||
if (options_vals_ptr[opt_idx] == nullptr) {
|
||||
|
||||
Yeni konuda referans
Bir kullanıcı engelle