MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / compute_2d_workgroups

Function compute_2d_workgroups

external/ggml/src/ggml-webgpu/ggml-webgpu.cpp:40–43  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
40static 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
45static inline uint32_t ggml_webgpu_u32_from_f32(float value) {
46 uint32_t bits;

Callers 5

ggml_webgpu_ssm_scanFunction · 0.85
ggml_webgpu_mul_matFunction · 0.85
ggml_webgpu_mul_mat_idFunction · 0.85
ggml_webgpu_add_idFunction · 0.85

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected