diff options
-rw-r--r-- | src/core/kernel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/kernel.cpp b/src/core/kernel.cpp index 92a0cca..c3fe391 100644 --- a/src/core/kernel.cpp +++ b/src/core/kernel.cpp @@ -83,6 +83,10 @@ Kernel::~Kernel() static bool matchDeviceOrParent(DeviceInterface *device_dep, DeviceInterface *device) { bool match = (device_dep == device); + + if (device == NULL) + return match; + DeviceInterface *next_device = device->parentDevice(); // If no match, device could be a sub-device - so go up the hierarchy checking parents: @@ -757,6 +761,9 @@ cl_int Kernel::workGroupInfo(DeviceInterface *device, cl_ulong cl_ulong_var; }; + if (device == NULL) + return CL_INVALID_DEVICE; + const DeviceDependent &dep = deviceDependent(device); if ((!device && p_device_dependent.size() > 1) || (&dep == &null_dep)) |