//////////////////////////////////////////////////////////////////// ManagedObject Implementation ///////////////////////////////////////// ////////////////////////////////////////////////////////////////////
| 30 | // ManagedObject Implementation ///////////////////////////////////////// |
| 31 | ///////////////////////////////////////////////////////////////////////// |
| 32 | void MultiDevice::commit() |
| 33 | { |
| 34 | Device::commit(); |
| 35 | |
| 36 | hostDevice.commit(); |
| 37 | |
| 38 | if (subdevices.empty()) { |
| 39 | auto OSPRAY_NUM_SUBDEVICES = |
| 40 | utility::getEnvVar<int>("OSPRAY_NUM_SUBDEVICES"); |
| 41 | int numSubdevices = |
| 42 | OSPRAY_NUM_SUBDEVICES.value_or(getParam("numSubdevices", 1)); |
| 43 | postStatusMsg(OSP_LOG_DEBUG) << "# of subdevices =" << numSubdevices; |
| 44 | |
| 45 | std::vector<std::shared_ptr<TiledLoadBalancer>> subdeviceLoadBalancers; |
| 46 | for (int i = 0; i < numSubdevices; ++i) { |
| 47 | std::unique_ptr<devicert::Device> drtDevice = |
| 48 | devicert::make_device_unique(i, debugMode); |
| 49 | auto d = rkcommon::make_unique<ISPCDevice>(std::move(drtDevice)); |
| 50 | d->commit(); |
| 51 | subdevices.emplace_back(std::move(d)); |
| 52 | subdeviceLoadBalancers.push_back(subdevices.back()->loadBalancer); |
| 53 | } |
| 54 | loadBalancer = |
| 55 | rkcommon::make_unique<MultiDeviceLoadBalancer>(subdeviceLoadBalancers); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | ///////////////////////////////////////////////////////////////////////// |
| 60 | // Device Implementation //////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected