diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-11-12 15:02:37 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-11-12 21:50:01 +0200 |
commit | 5c8f76ff6c9cd74325572e9078021e318fd72afe (patch) | |
tree | 3ba681aa59f06364dabf46255c01474e10ef1e1d | |
parent | de99aa16c0fbbd2801c5f90788adbea7013be11f (diff) |
Add comment that replies to the question in comment above
Change-Id: Iad8896df4491b2b4363fb2d16134e92dd9545c35
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 3812bd752358..4516af5dc667 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -909,8 +909,17 @@ bool switchOpenCLDevice(const OUString* pDevice, bool bAutoSelect, bool bForceEv OpenCLDevice::initOpenCLAttr(&env); // why do we need this at all? + + // (Assuming the above question refers to the mpArryDevsID + // initialisation below.) Because otherwise the code crashes in + // initOpenCLRunEnv(). Note that the initOpenCLAttr() call above + // sets mnIsUserCreated to 1, thus the code in initOpenCLRunEnv() + // that would initialise mpArryDevsID is not executed. Confused? + // You should be. + OpenCLDevice::gpuEnv.mpArryDevsID = (cl_device_id*) malloc( sizeof(cl_device_id) ); OpenCLDevice::gpuEnv.mpArryDevsID[0] = pDeviceId; + return !OpenCLDevice::initOpenCLRunEnv(0); } |