Skip to content

Commit 3932fd5

Browse files
committed
[fix] Correct the incorrect order of the parameters.
fix casting to int. Signed-off-by: Changyeon Kim <[email protected]>
1 parent e7cbdcf commit 3932fd5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ggml/src/ggml-vulkan.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4943,12 +4943,12 @@ static void ggml_vk_timestep_embedding(ggml_backend_vk_context * ctx, vk_context
49434943

49444944
static void ggml_vk_pool_2d(ggml_backend_vk_context * ctx, vk_context& subctx, const ggml_tensor * src0, ggml_tensor * dst, bool dryrun = false) {
49454945
uint32_t op = static_cast<uint32_t>(dst->op_params[0]);
4946-
const int32_t k0 = dst->op_params[1];
4947-
const int32_t k1 = dst->op_params[2];
4948-
const int32_t s0 = dst->op_params[3];
4949-
const int32_t s1 = dst->op_params[4];
4950-
const int32_t p0 = dst->op_params[5];
4951-
const int32_t p1 = dst->op_params[6];
4946+
const int32_t k1 = dst->op_params[1];
4947+
const int32_t k0 = dst->op_params[2];
4948+
const int32_t s1 = dst->op_params[3];
4949+
const int32_t s0 = dst->op_params[4];
4950+
const int32_t p1 = dst->op_params[5];
4951+
const int32_t p0 = dst->op_params[6];
49524952

49534953
const uint32_t IH = src0->ne[1];
49544954
const uint32_t IW = src0->ne[0];

ggml/src/vulkan-shaders/pool2d.comp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ void main() {
3737
const uint cur_oh = (idx % O_HW) / p.OW;
3838
const uint cur_ow = (idx % O_HW) % p.OW;
3939

40-
const uint start_h = cur_oh * p.s0 - p.p0;
40+
const int start_h = int(cur_oh) * p.s0 - p.p0;
4141
const uint bh = max(start_h, 0);
4242
const uint eh = min(start_h + p.k0, p.IH);
4343

44-
const uint start_w = cur_ow * p.s1 - p.p1;
44+
const int start_w = int(cur_ow) * p.s1 - p.p1;
4545
const uint bw = max(start_w, 0);
4646
const uint ew = min(start_w + p.k1, p.IW);
4747

0 commit comments

Comments
 (0)