Set event->_stream on hipHccModuleLaunchKernel path if start/stop used

Ensure _stream is always non-null in recorded events.
Fixes isDefaultStream fault.


[ROCm/hip commit: cb60763737]
This commit is contained in:
Ben Sander
2017-05-30 21:54:33 -05:00
bovenliggende f99ab93b61
commit 59833bea80
3 gewijzigde bestanden met toevoegingen van 7 en 4 verwijderingen
+3 -1
Bestand weergeven
@@ -42,11 +42,13 @@ ihipEvent_t::ihipEvent_t(unsigned flags)
// Attach to an existing completion future:
void ihipEvent_t::attachToCompletionFuture(const hc::completion_future *cf, ihipEventType_t eventType)
void ihipEvent_t::attachToCompletionFuture(const hc::completion_future *cf,
hipStream_t stream, ihipEventType_t eventType)
{
_state = hipEventStatusRecording;
_marker = *cf;
_type = eventType;
_stream = stream;
}
+2 -1
Bestand weergeven
@@ -538,6 +538,7 @@ public:
const ihipDevice_t * getDevice() const;
ihipCtx_t * getCtx() const;
// Before calling this function, stream must be resolved from "0" to the actual stream:
bool isDefaultStream() const { return _id == 0; };
public:
@@ -602,7 +603,7 @@ enum ihipEventType_t {
class ihipEvent_t {
public:
ihipEvent_t(unsigned flags);
void attachToCompletionFuture(const hc::completion_future *cf, ihipEventType_t eventType);
void attachToCompletionFuture(const hc::completion_future *cf, hipStream_t stream, ihipEventType_t eventType);
void setTimestamp();
uint64_t timestamp() const { return _timestamp; } ;
ihipEventType_t type() const { return _type; };
+2 -2
Bestand weergeven
@@ -455,10 +455,10 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
if (startEvent) {
startEvent->attachToCompletionFuture(&cf, hipEventTypeStartCommand);
startEvent->attachToCompletionFuture(&cf, hStream, hipEventTypeStartCommand);
}
if (stopEvent) {
stopEvent->attachToCompletionFuture (&cf, hipEventTypeStopCommand);
stopEvent->attachToCompletionFuture (&cf, hStream, hipEventTypeStopCommand);
}