SWDEV-326382 - Fix Pytorch test failures with hiprtc

hiprtcCreateProgram should create program even if the name passed
is NULL or empty string

Change-Id: Ide5ea70f6c5d96b0f26320cef277508cdbe8dfde


[ROCm/clr commit: 2ab2e0d020]
This commit is contained in:
Satyanvesh Dittakavi
2022-03-14 13:23:20 +00:00
szülő 8a831bfa39
commit 957b1173d5
@@ -75,11 +75,13 @@ hiprtcResult hiprtcCreateProgram(hiprtcProgram* prog, const char* src, const cha
if (numHeaders && (headers == nullptr || headerNames == nullptr)) {
HIPRTC_RETURN(HIPRTC_ERROR_INVALID_INPUT);
}
if(name == nullptr) {
HIPRTC_RETURN(HIPRTC_ERROR_INVALID_INPUT);
std::string progName;
if (name) {
progName = name;
}
auto* rtcProgram = new hiprtc::RTCProgram(std::string(name));
auto* rtcProgram = new hiprtc::RTCProgram(progName);
if (rtcProgram == nullptr) {
HIPRTC_RETURN(HIPRTC_ERROR_PROGRAM_CREATION_FAILURE);
}