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]
This commit is contained in:
foreman
2016-05-03 17:00:14 -04:00
parent 21610ac41b
commit be4288bc18
10 changed files with 90 additions and 66 deletions
@@ -30,25 +30,40 @@ class Context : public RuntimeObject
std::vector<Device*> devices_;
public:
enum DeviceFlagIdx
{
GLDeviceKhrIdx = 0, //!< GL
D3D10DeviceKhrIdx, //!< D3D10
OfflineDevicesIdx, //!< Offline devices
CommandInterceptIdx, //!< Command intercept
D3D11DeviceKhrIdx, //!< D3D11
InteropUserSyncIdx, //!< Interop user sync enabled
D3D9DeviceKhrIdx, //!< d3d9 device
D3D9DeviceEXKhrIdx, //!< d3d9EX device
D3D9DeviceVAKhrIdx, //!< d3d9VA device
EGLDeviceKhrIdx, //!< EGL device
LastDeviceFlagIdx
};
enum Flags
{
GLDeviceKhr = 1<<0, //!< GL
D3D10DeviceKhr = 1<<1, //!< D3D10
OfflineDevices = 1<<2, //!< Offline devices
CommandIntercept = 1<<3, //!< Command intercept
D3D11DeviceKhr = 1<<4, //!< D3D11
InteropUserSync = 1<<5, //!< Interop user sync enabled
D3D9DeviceKhr = 1<<6, //!< d3d9 device
D3D9DeviceEXKhr = 1<<7, //!< d3d9EX device
D3D9DeviceVAKhr = 1<<8, //!< d3d9VA device
EGLDeviceKhr = 1<<9, //!< EGL device
GLDeviceKhr = 1 << GLDeviceKhrIdx, //!< GL
D3D10DeviceKhr = 1 << D3D10DeviceKhrIdx, //!< D3D10
OfflineDevices = 1 << OfflineDevicesIdx, //!< Offline devices
CommandIntercept = 1 << CommandInterceptIdx, //!< Command intercept
D3D11DeviceKhr = 1 << D3D11DeviceKhrIdx, //!< D3D11
InteropUserSync = 1 << InteropUserSyncIdx, //!< Interop user sync enabled
D3D9DeviceKhr = 1 << D3D9DeviceKhrIdx, //!< d3d9 device
D3D9DeviceEXKhr = 1 << D3D9DeviceEXKhrIdx, //!< d3d9EX device
D3D9DeviceVAKhr = 1 << D3D9DeviceVAKhrIdx, //!< d3d9VA device
EGLDeviceKhr = 1 << EGLDeviceKhrIdx, //!< EGL device
};
//! Context info structure
struct Info
{
uint flags_; //!< Context info flags
void* hDev_; //!< Device object reference
void* hDev_[LastDeviceFlagIdx]; //!< Device object reference
void* hCtx_; //!< Context object reference
size_t propertiesSize_;//!< Size of the original properties in bytes
cl_int (CL_CALLBACK * commandIntercept_)(cl_event, cl_int *);