diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-07-11 11:43:57 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-07-11 12:06:05 +0300 |
commit | 2812451c08ed222b57dd6e8d790ba4bada581719 (patch) | |
tree | 890308ea82b735149f3c1a7aeb8dad3d8d4520b1 /sc | |
parent | ca3c7595221073315661458fbabc08850c2b4e58 (diff) |
Re-do 5dff961ba5fab6d451d9d993e076d190a93be495: Don't look for just GPUs
Surely we want to use any available device, not just a GPU? If what we
want is to *prefer* GPUs, the code need to be changed then to work
like that.
Change-Id: Ic689c3ab914de3cb77e5af686f0c330a9257d8fb
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/openclwrapper.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index e377dc1cfda4..f7674795837b 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -191,7 +191,7 @@ int OpenclDevice::BinaryGenerated(const char * clFileName, FILE ** fhandle) FILE *fd = NULL; cl_uint numDevices=0; status = clGetDeviceIDs(gpuEnv.mpPlatformID, // platform - CL_DEVICE_TYPE_GPU, // device_type + CL_DEVICE_TYPE_ALL, // device_type 0, // num_entries NULL, // devices ID &numDevices); @@ -670,7 +670,7 @@ int OpenclDevice::InitOpenclRunEnv(GPUEnv *gpuInfo) gpuInfo->mpPlatformID = platforms[i]; status = clGetDeviceIDs(gpuInfo->mpPlatformID, // platform - CL_DEVICE_TYPE_GPU, // device_type + CL_DEVICE_TYPE_ALL, // device_type 0, // num_entries NULL, // devices &numDevices); @@ -700,12 +700,15 @@ int OpenclDevice::InitOpenclRunEnv(GPUEnv *gpuInfo) gpuInfo->mpContext = clCreateContextFromType(cps, gpuInfo->mDevType, NULL, NULL, &status); + // If no GPU, check for CPU. if ((gpuInfo->mpContext == (cl_context) NULL) || (status != CL_SUCCESS)) { gpuInfo->mDevType = CL_DEVICE_TYPE_CPU; gpuInfo->mpContext = clCreateContextFromType(cps, gpuInfo->mDevType, NULL, NULL, &status); } + + // If no GPU or CPU, check for a "default" type. if ((gpuInfo->mpContext == (cl_context) NULL) || (status != CL_SUCCESS)) { gpuInfo->mDevType = CL_DEVICE_TYPE_DEFAULT; |