Set event->_stream on hipHccModuleLaunchKernel path if start/stop used
Ensure _stream is always non-null in recorded events. Fixes isDefaultStream fault.
Этот коммит содержится в:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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; };
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user