From a60ce1ef656cc98da095bf3113d1ed7cc9a98f29 Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 13 May 2015 12:20:57 -0400 Subject: [PATCH] P4 to Git Change 1150377 by gandryey@gera-w8 on 2015/05/13 11:39:13 EPR #419351 - clEnqueueNDRange crash if one doesn't create a device queue and use device enqueue in the kernel - add a check for defQueue is NULL in case the app didn't create one. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#510 edit [ROCm/clr commit: 22e298d645f680f79fbb05a292cf5a8dc565f051] --- projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp index 8e072c8639..81b78cc6c7 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gpudevice.cpp @@ -2420,8 +2420,13 @@ Device::validateKernel(const amd::Kernel& kernel, const device::VirtualDevice* v if (hsaKernel->dynamicParallelism()) { amd::DeviceQueue* defQueue = kernel.program().context().defDeviceQueue(*this); - vgpu = static_cast(defQueue->vDev()); - if (!allocScratch(hsaKernel->prog().maxScratchRegs(), vgpu)) { + if (defQueue != NULL) { + vgpu = static_cast(defQueue->vDev()); + if (!allocScratch(hsaKernel->prog().maxScratchRegs(), vgpu)) { + return false; + } + } + else { return false; } }