@brief Compute the density overflow for fixed cells. This map can be used as the initial density map since it only needs to be computed once. @param bin_center_x_tensor bin center x locations @param bin_center_y_tensor bin center y locations @param xl left boundary @param yl bottom boundary @param xh right boundary @param yh top boundary @param bin_size_x bin width @param bin_size_y bin height @pa
| 179 | /// @param num_terminals number of fixed cells |
| 180 | /// @return a density map for fixed cells |
| 181 | at::Tensor fixed_density_map(at::Tensor pos, at::Tensor node_size_x, |
| 182 | at::Tensor node_size_y, at::Tensor bin_center_x, |
| 183 | at::Tensor bin_center_y, double xl, double yl, |
| 184 | double xh, double yh, double bin_size_x, |
| 185 | double bin_size_y, int num_movable_nodes, |
| 186 | int num_terminals) { |
| 187 | int num_bins_x = int(ceil((xh - xl) / bin_size_x)); |
| 188 | int num_bins_y = int(ceil((yh - yl) / bin_size_y)); |
| 189 | int num_nodes = pos.numel() / 2; |
| 190 | at::Tensor density_map = at::zeros({num_bins_x, num_bins_y}, pos.options()); |
| 191 | |
| 192 | if (num_terminals) { |
| 193 | // Call the cuda kernel launcher |
| 194 | DREAMPLACE_DISPATCH_FLOATING_TYPES( |
| 195 | pos, "computeDensityMapLauncher", [&] { |
| 196 | computeDensityMapLauncher<scalar_t>( |
| 197 | DREAMPLACE_TENSOR_DATA_PTR(pos, scalar_t) + num_movable_nodes, |
| 198 | DREAMPLACE_TENSOR_DATA_PTR(pos, scalar_t) + num_nodes + |
| 199 | num_movable_nodes, |
| 200 | DREAMPLACE_TENSOR_DATA_PTR(node_size_x, scalar_t) + |
| 201 | num_movable_nodes, |
| 202 | DREAMPLACE_TENSOR_DATA_PTR(node_size_y, scalar_t) + |
| 203 | num_movable_nodes, |
| 204 | DREAMPLACE_TENSOR_DATA_PTR(bin_center_x, scalar_t), |
| 205 | DREAMPLACE_TENSOR_DATA_PTR(bin_center_y, scalar_t), num_terminals, |
| 206 | num_bins_x, num_bins_y, xl, yl, xh, yh, bin_size_x, bin_size_y, |
| 207 | at::get_num_threads(), |
| 208 | DREAMPLACE_TENSOR_DATA_PTR(density_map, scalar_t)); |
| 209 | }); |
| 210 | } |
| 211 | |
| 212 | return density_map; |
| 213 | } |
| 214 | |
| 215 | DREAMPLACE_END_NAMESPACE |
| 216 |
nothing calls this directly
no outgoing calls
no test coverage detected