Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/integrator/work_balancer.h
| Show All 18 Lines | |||||
| #include "util/util_vector.h" | #include "util/util_vector.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| struct WorkBalanceInfo { | struct WorkBalanceInfo { | ||||
| /* Time spent performing corresponding work. */ | /* Time spent performing corresponding work. */ | ||||
| double time_spent = 0; | double time_spent = 0; | ||||
| /* Average occupancy of the device while performing the work. */ | |||||
| float occupancy = 1.0f; | |||||
| /* Normalized weight, which is ready to be used for work balancing (like calculating fraction of | /* Normalized weight, which is ready to be used for work balancing (like calculating fraction of | ||||
| * the big tile which is to be rendered on the device). */ | * the big tile which is to be rendered on the device). */ | ||||
| double weight = 1.0; | double weight = 1.0; | ||||
| }; | }; | ||||
| /* Balance work for an initial render interation, before any statistics is known. */ | /* Balance work for an initial render interation, before any statistics is known. */ | ||||
| void work_balance_do_initial(vector<WorkBalanceInfo> &work_balance_infos); | void work_balance_do_initial(vector<WorkBalanceInfo> &work_balance_infos); | ||||
| /* Rebalance work after statistics has been accumulated. | /* Rebalance work after statistics has been accumulated. | ||||
| * Returns true if the balancing did change. */ | * Returns true if the balancing did change. */ | ||||
| bool work_balance_do_rebalance(vector<WorkBalanceInfo> &work_balance_infos); | bool work_balance_do_rebalance(vector<WorkBalanceInfo> &work_balance_infos); | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||