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
Dieser Commit ist enthalten in:
Satyanvesh Dittakavi
2022-03-14 13:23:20 +00:00
Ursprung be2331bf7b
Commit 2ab2e0d020
+5 -3
Datei anzeigen
@@ -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);
}