SWDEV-446123 - Match hipGetLastError behavior with CUDA using env var
Change-Id: Iaec697c1304d746376ecf2bfe2ad683b15ee189f
此提交包含在:
+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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
新增問題並參考
封鎖使用者