[fix] Correct the incorrect order of the parameters.

fix casting to int.

Signed-off-by: Changyeon Kim <cyzero.kim@samsung.com>
This commit is contained in:
Changyeon Kim 2024-10-27 00:50:22 +09:00
parent e7cbdcf0a2
commit 3932fd5740
2 changed files with 8 additions and 8 deletions

View file

@ -4943,12 +4943,12 @@ static void ggml_vk_timestep_embedding(ggml_backend_vk_context * ctx, vk_context
static void ggml_vk_pool_2d(ggml_backend_vk_context * ctx, vk_context& subctx, const ggml_tensor * src0, ggml_tensor * dst, bool dryrun = false) {
uint32_t op = static_cast<uint32_t>(dst->op_params[0]);
const int32_t k0 = dst->op_params[1];
const int32_t k1 = dst->op_params[2];
const int32_t s0 = dst->op_params[3];
const int32_t s1 = dst->op_params[4];
const int32_t p0 = dst->op_params[5];
const int32_t p1 = dst->op_params[6];
const int32_t k1 = dst->op_params[1];
const int32_t k0 = dst->op_params[2];
const int32_t s1 = dst->op_params[3];
const int32_t s0 = dst->op_params[4];
const int32_t p1 = dst->op_params[5];
const int32_t p0 = dst->op_params[6];
const uint32_t IH = src0->ne[1];
const uint32_t IW = src0->ne[0];

View file

@ -37,11 +37,11 @@ void main() {
const uint cur_oh = (idx % O_HW) / p.OW;
const uint cur_ow = (idx % O_HW) % p.OW;
const uint start_h = cur_oh * p.s0 - p.p0;
const int start_h = int(cur_oh) * p.s0 - p.p0;
const uint bh = max(start_h, 0);
const uint eh = min(start_h + p.k0, p.IH);
const uint start_w = cur_ow * p.s1 - p.p1;
const int start_w = int(cur_ow) * p.s1 - p.p1;
const uint bw = max(start_w, 0);
const uint ew = min(start_w + p.k1, p.IW);