P4 to Git Change 1264764 by wchau@wchau_WIN_OCL_HSA on 2016/05/03 16:46:02

SWDEV-93075 - [OCL] Access violation in clCreateContext() in amdocl.dll when DX9 and DX11 devices are used.  Add support for multiple external devices for context creation to make sure the devices are initialized with proper type.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#50 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d10.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d11.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_d3d9.cpp#29 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.hpp#95 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#274 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#547 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#160 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#128 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.cpp#62 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.hpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#41 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#25 edit


[ROCm/clr commit: 6a5cdbf60c]
Este commit está contenido en:
foreman
2016-05-03 17:00:14 -04:00
padre 21610ac41b
commit be4288bc18
Se han modificado 10 ficheros con 90 adiciones y 66 borrados
@@ -118,52 +118,50 @@ Context::checkProperties(
if (p->ptr == NULL) {
return CL_INVALID_VALUE;
}
info->hDev_ = p->ptr;
info->hDev_[D3D10DeviceKhrIdx] = p->ptr;
info->flags_ |= D3D10DeviceKhr;
break;
case CL_CONTEXT_D3D11_DEVICE_KHR:
if (p->ptr == NULL) {
return CL_INVALID_VALUE;
}
info->hDev_ = p->ptr;
info->hDev_[D3D11DeviceKhrIdx] = p->ptr;
info->flags_ |= D3D11DeviceKhr;
break;
case CL_CONTEXT_ADAPTER_D3D9_KHR:
if (p->ptr == NULL) { //not supported for xp
return CL_INVALID_VALUE;
}
info->hDev_ = p->ptr;
info->hDev_[D3D9DeviceKhrIdx] = p->ptr;
info->flags_ |= D3D9DeviceKhr;
break;
case CL_CONTEXT_ADAPTER_D3D9EX_KHR:
if (p->ptr == NULL) {
return CL_INVALID_VALUE;
}
info->hDev_ = p->ptr;
info->hDev_[D3D9DeviceEXKhrIdx] = p->ptr;
info->flags_ |= D3D9DeviceEXKhr;
break;
case CL_CONTEXT_ADAPTER_DXVA_KHR:
if (p->ptr == NULL) {
return CL_INVALID_VALUE;
}
info->hDev_ = p->ptr;
info->hDev_[D3D9DeviceVAKhrIdx] = p->ptr;
info->flags_ |= D3D9DeviceVAKhr;
break;
#endif //_WIN32
case CL_EGL_DISPLAY_KHR:
info->hDev_ = p->ptr;
info->flags_ |= EGLDeviceKhr;
#ifdef _WIN32
case CL_WGL_HDC_KHR:
info->hDev_ = p->ptr;
#endif //_WIN32
#if defined(__linux__)
case CL_GLX_DISPLAY_KHR:
info->hDev_ = p->ptr;
#endif //linux
info->hDev_[GLDeviceKhrIdx] = p->ptr;
#if defined(__APPLE__) || defined(__MACOSX)
case CL_CGL_SHAREGROUP_KHR:
@@ -267,7 +265,7 @@ Context::create(const intptr_t* properties)
);
if (h && (glenv_ = new GLFunctions(h, (info_.flags_ & Flags::EGLDeviceKhr) != 0))) {
if (!glenv_->init(reinterpret_cast<intptr_t>(info_.hDev_),
if (!glenv_->init(reinterpret_cast<intptr_t>(info_.hDev_[GLDeviceKhrIdx]),
reinterpret_cast<intptr_t>(info_.hCtx_))) {
delete glenv_;
glenv_ = NULL;