diff options
author | Tom Stellard <[email protected]> | 2012-06-28 20:05:21 +0000 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2012-07-01 15:45:24 +0200 |
commit | 1d21bd057a6b1701dd44a79e82259c0f3ded2b70 (patch) | |
tree | 3eb4dd20cf4a9e3a1057719c0552fd6fde99607f | |
parent | c6bb41c28b2da269d5b692d1d0f4acbf3cdd4b5c (diff) |
clover: Handle NULL devs argument in clBuildProgram
If devs is NULL, then the kernel should be compiled for all devices
associated with the program.
-rw-r--r-- | src/gallium/state_trackers/clover/api/program.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index e874c51ad7d..b167904377f 100644 --- a/src/gallium/state_trackers/clover/api/program.cpp +++ b/src/gallium/state_trackers/clover/api/program.cpp @@ -142,12 +142,17 @@ clBuildProgram(cl_program prog, cl_uint count, const cl_device_id *devs, (!pfn_notify && user_data)) throw error(CL_INVALID_VALUE); - if (any_of([&](const cl_device_id dev) { - return !prog->ctx.has_device(dev); - }, devs, devs + count)) - throw error(CL_INVALID_DEVICE); + if (devs) { + if (any_of([&](const cl_device_id dev) { + return !prog->ctx.has_device(dev); + }, devs, devs + count)) + throw error(CL_INVALID_DEVICE); + + prog->build({ devs, devs + count }); + } else { + prog->build(prog->ctx.devs); + } - prog->build({ devs, devs + count }); return CL_SUCCESS; } catch (error &e) { |