Return a rectangular grid of workgroups with minimal over-provisioned workgroups. Assumes that the total number of workgroups does not exceed max_per_dim^2.
| 38 | // Return a rectangular grid of workgroups with minimal over-provisioned workgroups. |
| 39 | // Assumes that the total number of workgroups does not exceed max_per_dim^2. |
| 40 | static inline void compute_2d_workgroups(uint32_t total_wg, uint32_t max_per_dim, uint32_t & wg_x, uint32_t & wg_y) { |
| 41 | wg_y = std::max(1u, CEIL_DIV(total_wg, max_per_dim)); |
| 42 | wg_x = CEIL_DIV(total_wg, wg_y); |
| 43 | } |
| 44 | |
| 45 | static inline uint32_t ggml_webgpu_u32_from_f32(float value) { |
| 46 | uint32_t bits; |
no test coverage detected