Partitions the device into multiple sub-devices according to \p properties. \opencl_version_warning{1,2}
| 328 | /// |
| 329 | /// \opencl_version_warning{1,2} |
| 330 | std::vector<device> |
| 331 | partition(const cl_device_partition_property *properties) const |
| 332 | { |
| 333 | // get sub-device count |
| 334 | uint_ count = 0; |
| 335 | int_ ret = clCreateSubDevices(m_id, properties, 0, 0, &count); |
| 336 | if(ret != CL_SUCCESS){ |
| 337 | BOOST_THROW_EXCEPTION(opencl_error(ret)); |
| 338 | } |
| 339 | |
| 340 | // get sub-device ids |
| 341 | std::vector<cl_device_id> ids(count); |
| 342 | ret = clCreateSubDevices(m_id, properties, count, &ids[0], 0); |
| 343 | if(ret != CL_SUCCESS){ |
| 344 | BOOST_THROW_EXCEPTION(opencl_error(ret)); |
| 345 | } |
| 346 | |
| 347 | // convert ids to device objects |
| 348 | std::vector<device> devices(count); |
| 349 | for(size_t i = 0; i < count; i++){ |
| 350 | devices[i] = device(ids[i], false); |
| 351 | } |
| 352 | |
| 353 | return devices; |
| 354 | } |
| 355 | |
| 356 | /// \opencl_version_warning{1,2} |
| 357 | std::vector<device> partition_equally(size_t count) const |