P4 to Git Change 1548145 by cpaquot@cpaquot-ocl-lc-lnx on 2018/04/30 21:15:56

SWDEV-145570 - [HIP] Handle hStream=nullptr case

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#7 edit
此提交包含在:
foreman
2018-04-30 21:20:26 -04:00
父節點 213f721318
當前提交 dc1497535d
+12 -2
查看文件
@@ -144,8 +144,14 @@ hipError_t hipModuleLaunchKernel(hipFunction_t f,
amd::Kernel* kernel = as_amd(reinterpret_cast<cl_kernel>(f));
amd::Device* device = g_context->devices()[0];
amd::HostQueue* queue = as_amd(reinterpret_cast<cl_command_queue>(hStream))->asHostQueue();
amd::HostQueue* queue;
if (hStream == nullptr) {
queue = new amd::HostQueue(*g_context, *device, 0,
amd::CommandQueue::RealTimeDisabled,
amd::CommandQueue::Priority::Normal);
} else {
queue = as_amd(reinterpret_cast<cl_command_queue>(hStream))->asHostQueue();
}
if (!queue) {
return hipErrorOutOfMemory;
}
@@ -194,6 +200,10 @@ hipError_t hipModuleLaunchKernel(hipFunction_t f,
command->awaitCompletion();
command->release();
if (hStream == nullptr) {
queue->release();
}
return hipSuccess;
}