SWDEV-446123 - Match hipGetLastError behavior with CUDA using env var

Change-Id: Iaec697c1304d746376ecf2bfe2ad683b15ee189f
This commit is contained in:
Satyanvesh Dittakavi
2024-08-01 15:01:24 +00:00
والد b5aab7f6b4
کامیت 5f477900a3
5فایلهای تغییر یافته به همراه37 افزوده شده و 13 حذف شده
+2 -2
مشاهده پرونده
@@ -439,7 +439,7 @@ hipError_t hipEventSynchronize(hipEvent_t event) {
hip::Stream* s = reinterpret_cast<hip::Stream*>(e->GetCaptureStream());
if ((s != nullptr) && (s->GetCaptureStatus() == hipStreamCaptureStatusActive)) {
s->SetCaptureStatus(hipStreamCaptureStatusInvalidated);
return HIP_RETURN(hipErrorCapturedEvent);
HIP_RETURN(hipErrorCapturedEvent);
}
if (hip::Stream::StreamCaptureOngoing(e->GetCaptureStream()) == true) {
HIP_RETURN(hipErrorStreamCaptureUnsupported);
@@ -460,7 +460,7 @@ hipError_t ihipEventQuery(hipEvent_t event) {
hip::Stream* s = reinterpret_cast<hip::Stream*>(e->GetCaptureStream());
if ((s != nullptr) && (s->GetCaptureStatus() == hipStreamCaptureStatusActive)) {
s->SetCaptureStatus(hipStreamCaptureStatusInvalidated);
return HIP_RETURN(hipErrorCapturedEvent);
HIP_RETURN(hipErrorCapturedEvent);
}
return e->query();
}
+25 -9
مشاهده پرونده
@@ -164,19 +164,34 @@ const char* ihipGetErrorName(hipError_t hip_error);
HIP_RETURN(hipErrorNoDevice); \
}
#define HIP_INIT_API_NO_RETURN(cid, ...) \
#define HIP_INIT_API_NO_RETURN(cid, ...) \
HIP_INIT_API_INTERNAL(1, cid, __VA_ARGS__)
#define HIP_RETURN_DURATION(ret, ...) \
hip::tls.last_error_ = ret; \
hip::tls.last_command_error_ = ret; \
if (DEBUG_HIP_7_PREVIEW & amd::CHANGE_HIP_GET_LAST_ERROR) { \
if (ret != hipSuccess && ret != hipErrorNotReady) { \
hip::tls.last_error_ = ret; \
} \
} else { \
hip::tls.last_error_ = ret; \
} \
HIPPrintDuration(amd::LOG_INFO, amd::LOG_API, &startTimeUs, "%s: Returned %s : %s", __func__, \
hip::ihipGetErrorName(hip::tls.last_error_), ToString(__VA_ARGS__).c_str()); \
return hip::tls.last_error_;
hip::ihipGetErrorName(hip::tls.last_command_error_), \
ToString(__VA_ARGS__).c_str()); \
return hip::tls.last_command_error_;
#define HIP_RETURN(ret, ...) \
hip::tls.last_error_ = ret; \
HIP_ERROR_PRINT(hip::tls.last_error_, __VA_ARGS__) \
return hip::tls.last_error_;
#define HIP_RETURN(ret, ...) \
hip::tls.last_command_error_ = ret; \
if (DEBUG_HIP_7_PREVIEW & amd::CHANGE_HIP_GET_LAST_ERROR) { \
if (ret != hipSuccess && ret != hipErrorNotReady) { \
hip::tls.last_error_ = ret; \
} \
} else { \
hip::tls.last_error_ = ret; \
} \
HIP_ERROR_PRINT(hip::tls.last_command_error_, __VA_ARGS__) \
return hip::tls.last_command_error_;
#define HIP_RETURN_ONFAIL(func) \
do { \
@@ -610,7 +625,7 @@ public:
public:
Device* device_;
std::stack<Device*> ctxt_stack_;
hipError_t last_error_;
hipError_t last_error_, last_command_error_;
std::vector<hip::Stream*> capture_streams_;
hipStreamCaptureMode stream_capture_mode_;
std::stack<ihipExec_t> exec_stack_;
@@ -618,6 +633,7 @@ public:
TlsAggregator(): device_(nullptr),
last_error_(hipSuccess),
last_command_error_(hipSuccess),
stream_capture_mode_(hipStreamCaptureModeGlobal) {
}
~TlsAggregator() {
+1 -1
مشاهده پرونده
@@ -4621,7 +4621,7 @@ hipError_t hipExternalMemoryGetMappedMipmappedArray(
hip::getNumChannels(mipmapDesc->formatDesc),
mipmapDesc->flags};
if (!hip::CheckArrayFormat(mipmapDesc->formatDesc)) {
return HIP_RETURN(hipErrorInvalidValue);
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(ihipMipmapArrayCreate(mipmap, &allocateArray, mipmapDesc->numLevels,
+5
مشاهده پرونده
@@ -68,6 +68,11 @@ enum LogMask {
LOG_ALWAYS = -1 //!< (0xFFFFFFFF) Log always even mask flag is zero
};
// Flags to support backward incompatible changes before 7.0
enum BreakingHipChange7 {
CHANGE_HIP_GET_LAST_ERROR = 1, //!< (0x1) HIP_GET_LAST_ERROR
};
//! \brief log file output
extern FILE* outFile;
+4 -1
مشاهده پرونده
@@ -266,9 +266,12 @@ release(bool, DEBUG_CLR_SYSMEM_POOL, true, \
release(bool, DEBUG_HIP_KERNARG_COPY_OPT, true, \
"Enable/Disable multiple kern arg copies") \
release(bool, DEBUG_CLR_USE_STDMUTEX_IN_AMD_MONITOR, false, \
"Use std::mutex in amd::monotor") \
"Use std::mutex in amd::monitor") \
release(bool, DEBUG_CLR_KERNARG_HDP_FLUSH_WA, false, \
"Toggle kernel arg copy workaround") \
release(uint, DEBUG_HIP_7_PREVIEW, 0, \
"Enables specific backward incompatible changes support before 7.0," \
"using the mask. By default the changes are disabled and is set to 0")\
namespace amd {