P4 to Git Change 1552807 by skudchad@skudchad_test2_win_opencl on 2018/05/09 18:08:07
SWDEV-145570 - [HIP] - Release a stream first before taking it off from the set.
- Queue::create() needs to be called before returning a valid queue.
ReviewBoardURL = http://ocltc.amd.com/reviews/r/14830/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#7 edit
[ROCm/clr commit: 1426982a65]
This commit is contained in:
@@ -32,15 +32,15 @@ static hipError_t ihipStreamCreateWithFlags(hipStream_t *stream, unsigned int fl
|
|||||||
amd::CommandQueue::RealTimeDisabled,
|
amd::CommandQueue::RealTimeDisabled,
|
||||||
amd::CommandQueue::Priority::Normal);
|
amd::CommandQueue::Priority::Normal);
|
||||||
|
|
||||||
|
if (queue == nullptr || !queue->create()) {
|
||||||
|
return hipErrorOutOfMemory;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(flags & hipStreamNonBlocking)) {
|
if (!(flags & hipStreamNonBlocking)) {
|
||||||
hip::syncStreams();
|
hip::syncStreams();
|
||||||
streamSet.insert(queue);
|
streamSet.insert(queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queue == nullptr) {
|
|
||||||
return hipErrorOutOfMemory;
|
|
||||||
}
|
|
||||||
|
|
||||||
*stream = reinterpret_cast<hipStream_t>(as_cl(queue));
|
*stream = reinterpret_cast<hipStream_t>(as_cl(queue));
|
||||||
|
|
||||||
return hipSuccess;
|
return hipSuccess;
|
||||||
@@ -101,10 +101,8 @@ hipError_t hipStreamDestroy(hipStream_t stream) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
amd::HostQueue* hostQueue = as_amd(reinterpret_cast<cl_command_queue>(stream))->asHostQueue();
|
amd::HostQueue* hostQueue = as_amd(reinterpret_cast<cl_command_queue>(stream))->asHostQueue();
|
||||||
|
|
||||||
streamSet.erase(hostQueue);
|
|
||||||
|
|
||||||
hostQueue->release();
|
hostQueue->release();
|
||||||
|
streamSet.erase(hostQueue);
|
||||||
|
|
||||||
return hipSuccess;
|
return hipSuccess;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user