MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / partition

Method partition

compute/include/boost/compute/device.hpp:330–354  ·  view source on GitHub ↗

Partitions the device into multiple sub-devices according to \p properties. \opencl_version_warning{1,2}

Source from the content-addressed store, hash-verified

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

Callers 4

get_parameter_infosFunction · 0.80
LGBMRankerClass · 0.80
top_k_errorFunction · 0.80

Calls 2

opencl_errorClass · 0.85
deviceClass · 0.85

Tested by 1

top_k_errorFunction · 0.64