diff options
author | Francisco Jerez <[email protected]> | 2013-09-15 20:06:57 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-21 10:47:02 -0700 |
commit | c9e009b74d4ca4c471d3d77960f232035876aaa8 (patch) | |
tree | 270f11e7be38a8a5b8bbe4f6eb7e8df99c9a707e /src/gallium/state_trackers/clover/api/context.cpp | |
parent | 49a49e0742dde4aa6d0c870d795a480425e85f52 (diff) |
clover: Switch device objects to the new model.
Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/api/context.cpp')
-rw-r--r-- | src/gallium/state_trackers/clover/api/context.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/clover/api/context.cpp b/src/gallium/state_trackers/clover/api/context.cpp index 43d5ac3b838..a03b9bb15c8 100644 --- a/src/gallium/state_trackers/clover/api/context.cpp +++ b/src/gallium/state_trackers/clover/api/context.cpp @@ -27,28 +27,23 @@ using namespace clover; PUBLIC cl_context clCreateContext(const cl_context_properties *props, cl_uint num_devs, - const cl_device_id *devs, + const cl_device_id *d_devs, void (CL_CALLBACK *pfn_notify)(const char *, const void *, size_t, void *), void *user_data, cl_int *errcode_ret) try { + auto devs = map(addresses(), objs(d_devs, num_devs)); auto mprops = property_map(props); - if (!devs || !num_devs || - (!pfn_notify && user_data)) + if (!pfn_notify && user_data) throw error(CL_INVALID_VALUE); - if (any_of(is_zero(), range(devs, num_devs))) - throw error(CL_INVALID_DEVICE); - for (auto p : mprops) { if (p.first != CL_CONTEXT_PLATFORM) throw error(CL_INVALID_PROPERTY); } ret_error(errcode_ret, CL_SUCCESS); - return new context( - property_vector(mprops), - std::vector<cl_device_id>(devs, devs + num_devs)); + return new context(property_vector(mprops), devs); } catch(error &e) { ret_error(errcode_ret, e); |