| 71 | /// @param density_map_tensor 2D density map in column-major to write |
| 72 | template <typename T> |
| 73 | int computeDensityMapLauncher(const T* x_tensor, const T* y_tensor, |
| 74 | const T* node_size_x_tensor, |
| 75 | const T* node_size_y_tensor, |
| 76 | const T* bin_center_x_tensor, |
| 77 | const T* bin_center_y_tensor, const int num_nodes, |
| 78 | const int num_bins_x, const int num_bins_y, |
| 79 | const T xl, const T yl, const T xh, const T yh, |
| 80 | const T bin_size_x, const T bin_size_y, |
| 81 | int num_threads, T* density_map_tensor) { |
| 82 | // density_map_tensor should be initialized outside |
| 83 | |
| 84 | #pragma omp parallel for num_threads(num_threads) |
| 85 | for (int i = 0; i < num_nodes; ++i) { |
| 86 | T bxl = x_tensor[i]; |
| 87 | T byl = y_tensor[i]; |
| 88 | T bxh = bxl + node_size_x_tensor[i]; |
| 89 | T byh = byl + node_size_y_tensor[i]; |
| 90 | distributeBox2Bin(bin_center_x_tensor, bin_center_y_tensor, num_bins_x, |
| 91 | num_bins_y, xl, yl, xh, yh, bin_size_x, bin_size_y, bxl, |
| 92 | byl, bxh, byh, density_map_tensor); |
| 93 | } |
| 94 | |
| 95 | return 0; |
| 96 | } |
| 97 | |
| 98 | /// @brief Compute density map. |
| 99 | /// @param pos cell locations, array of x locations and then y locations |
nothing calls this directly
no outgoing calls
no test coverage detected