diff --git a/hipamd/src/hiprtc/hiprtc.cpp b/hipamd/src/hiprtc/hiprtc.cpp index 169b5fe21e..01bb208bce 100644 --- a/hipamd/src/hiprtc/hiprtc.cpp +++ b/hipamd/src/hiprtc/hiprtc.cpp @@ -112,11 +112,10 @@ hiprtcResult hiprtcCompileProgram(hiprtcProgram prog, int numOptions, const char std::vector 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(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); } diff --git a/hipamd/src/hiprtc/hiprtcInternal.cpp b/hipamd/src/hiprtc/hiprtcInternal.cpp index 83fd089c69..693064f077 100644 --- a/hipamd/src/hiprtc/hiprtcInternal.cpp +++ b/hipamd/src/hiprtc/hiprtcInternal.cpp @@ -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) {