Improve debug print messages.

- Remove "call-to-call" for hipStreamCreate and hipEventCreate.
  These now call an internal functions rather than calling through
  hipStreamCreateWithFalgs and hipEventCreateWithFlags.

- Add HIP_INIT_API for more functions so they trace correctly.

- Use stream#DEVICE.STREAMID in debug messages via new specialization in
  tace_helper.
This commit is contained in:
Ben Sander
2016-03-26 12:35:04 -05:00
parent 395e7eab96
commit 7934cf620d
6 ha cambiato i file con 87 aggiunte e 30 eliminazioni
+24 -9
Vedi File
@@ -28,10 +28,8 @@ THE SOFTWARE.
//
//---
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
hipError_t ihipStreamCreate(hipStream_t *stream, unsigned int flags)
{
std::call_once(hip_initialized, ihipInit);
ihipDevice_t *device = ihipGetTlsDefaultDevice();
hc::accelerator acc = device->_acc;
@@ -48,7 +46,25 @@ hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
*stream = istream;
tprintf(DB_SYNC, "hipStreamCreate, stream=%p\n", *stream);
return ihipLogStatus(hipSuccess);
return hipSuccess;
}
//---
hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
{
HIP_INIT_API(stream, flags);
return ihipLogStatus(ihipStreamCreate(stream, flags));
}
//---
hipError_t hipStreamCreate(hipStream_t *stream)
{
HIP_INIT_API(stream);
return ihipLogStatus(ihipStreamCreate(stream, hipStreamDefault));
}
@@ -58,8 +74,7 @@ hipError_t hipStreamCreateWithFlags(hipStream_t *stream, unsigned int flags)
*/
hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int flags)
{
std::call_once(hip_initialized, ihipInit);
HIP_INIT_API(stream, event, flags);
hipError_t e = hipSuccess;
@@ -78,7 +93,7 @@ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int
//---
hipError_t hipStreamSynchronize(hipStream_t stream)
{
std::call_once(hip_initialized, ihipInit);
HIP_INIT_API(stream);
hipError_t e = hipSuccess;
@@ -101,7 +116,7 @@ hipError_t hipStreamSynchronize(hipStream_t stream)
*/
hipError_t hipStreamDestroy(hipStream_t stream)
{
std::call_once(hip_initialized, ihipInit);
HIP_INIT_API(stream);
hipError_t e = hipSuccess;
@@ -130,7 +145,7 @@ hipError_t hipStreamDestroy(hipStream_t stream)
//---
hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int *flags)
{
std::call_once(hip_initialized, ihipInit);
HIP_INIT_API(stream, flags);
if (flags == NULL) {
return ihipLogStatus(hipErrorInvalidValue);