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
此提交包含在:
+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;
|
||||
}
|
||||
|
||||
|
||||
新增問題並參考
封鎖使用者