File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -476,14 +476,18 @@ static void fixup_rr_indexed_data_T_values(size_t num_segment) {
476
476
cost_index < CHANX_COST_INDEX_START + 2 * num_segment; cost_index++) {
477
477
int ortho_cost_index = device_ctx.rr_indexed_data [cost_index].ortho_cost_index ;
478
478
479
+ auto & indexed_data = device_ctx.rr_indexed_data [cost_index];
480
+ auto & ortho_indexed_data = device_ctx.rr_indexed_data [ortho_cost_index];
479
481
// Check if this data is uninitialized, but the orthogonal data is
480
482
// initialized.
481
- if (!std::isfinite (device_ctx.rr_indexed_data [cost_index].T_linear )
482
- && std::isfinite (device_ctx.rr_indexed_data [ortho_cost_index].T_linear )) {
483
+ // Uninitialized data is set to zero by default.
484
+ bool needs_fixup = indexed_data.T_linear == 0 && indexed_data.T_quadratic == 0 && indexed_data.C_load == 0 ;
485
+ bool ortho_data_valid = ortho_indexed_data.T_linear != 0 || ortho_indexed_data.T_quadratic != 0 || ortho_indexed_data.C_load != 0 ;
486
+ if (needs_fixup && ortho_data_valid) {
483
487
// Copy orthogonal data over.
484
- device_ctx. rr_indexed_data [cost_index]. T_linear = device_ctx. rr_indexed_data [ortho_cost_index] .T_linear ;
485
- device_ctx. rr_indexed_data [cost_index]. T_quadratic = device_ctx. rr_indexed_data [ortho_cost_index] .T_quadratic ;
486
- device_ctx. rr_indexed_data [cost_index]. C_load = device_ctx. rr_indexed_data [ortho_cost_index] .C_load ;
488
+ indexed_data. T_linear = ortho_indexed_data .T_linear ;
489
+ indexed_data. T_quadratic = ortho_indexed_data .T_quadratic ;
490
+ indexed_data. C_load = ortho_indexed_data .C_load ;
487
491
}
488
492
}
489
493
}
You can’t perform that action at this time.
0 commit comments