Only use ihipLogStatus from top-level HIP functions.

Change-Id: I07e9c088d5c16a79ed52cb008a798889a656016c


[ROCm/hip commit: db9fe9f494]
This commit is contained in:
Ben Sander
2016-09-01 17:58:24 -05:00
rodzic 85ae05c401
commit d3fb92374d
5 zmienionych plików z 7 dodań i 10 usunięć
+2
Wyświetl plik
@@ -121,6 +121,8 @@ Differences or limitations of HIP APIs as compared to CUDA APIs should be clearl
- HIP_INIT_API() should be placed at the start of each top-level HIP API. This function will make sure the HIP runtime is initialized,
and also constructs an appropriate API string for tracing and CodeXL marker tracing. The arguments to HIP_INIT_API should match
those of the parent fucntion.
- ihipLogStatus should only be called from top-level HIP APIs,and should be called to log and return the error code. The error code
is used by the GetLastError and PeekLastError functions - if a HIP API simply returns, then the error will not be logged correctly.
#### Presubmit Testing:
@@ -683,7 +683,7 @@ extern const char *ihipErrorString(hipError_t);
extern ihipCtx_t *ihipGetTlsDefaultCtx();
extern void ihipSetTlsDefaultCtx(ihipCtx_t *ctx);
extern hipError_t ihipSynchronize(void);
extern hipError_t ihipCtxStackUpdate();
extern void ihipCtxStackUpdate();
extern ihipDevice_t *ihipGetDevice(int);
ihipCtx_t * ihipGetPrimaryCtx(unsigned deviceIndex);
+2 -7
Wyświetl plik
@@ -29,16 +29,11 @@ THE SOFTWARE.
// Stack of contexts
thread_local std::stack<ihipCtx_t *> tls_ctxStack;
hipError_t ihipCtxStackUpdate()
void ihipCtxStackUpdate()
{
//HIP_INIT_API();
hipError_t e = hipSuccess;
if(tls_ctxStack.empty()) {
tls_ctxStack.push(ihipGetTlsDefaultCtx());
tls_ctxStack.push(ihipGetTlsDefaultCtx());
}
return ihipLogStatus(e);
}
hipError_t hipInit(unsigned int flags)
+1 -1
Wyświetl plik
@@ -160,7 +160,7 @@ hipError_t hipSetDevice(int deviceId)
*/
hipError_t hipDeviceSynchronize(void)
{
HIP_INIT_API(1);
HIP_INIT_API();
return ihipSynchronize();
}
+1 -1
Wyświetl plik
@@ -162,7 +162,7 @@ hipError_t ihipSynchronize(void)
{
ihipGetTlsDefaultCtx()->locked_waitAllStreams(); // ignores non-blocking streams, this waits for all activity to finish.
return ihipLogStatus(hipSuccess);
return (hipSuccess);
}
//=================================================================================================