MCPcopy Create free account
hub / github.com/apache/singa / GetNumOpenclDevices

Method GetNumOpenclDevices

src/core/device/platform.cc:158–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158const int Platform::GetNumOpenclDevices() {
159 auto all_platforms = viennacl::ocl::get_platforms();
160 unsigned int total_num_devices = 0;
161 for (auto plat : all_platforms) {
162 auto all_devices = plat.devices(CL_DEVICE_TYPE_ALL);
163 total_num_devices += all_devices.size();
164 }
165 return (int)total_num_devices;
166}
167
168const std::shared_ptr<Device> Platform::GetDefaultOpenclDevice() {
169 return std::make_shared<OpenclDevice>();

Callers 1

get_num_opencl_devicesFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected