Skip to content

Commit f8d1bf2

Browse files
author
alexju
committed
metal: Change im2col offset types from int32_t to uint64_t to support larger memory offsets
1 parent 15769e6 commit f8d1bf2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ggml/src/ggml-metal/ggml-metal-impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ typedef struct {
286286
} ggml_metal_kargs_rms_norm;
287287

288288
typedef struct {
289-
int32_t ofs0;
290-
int32_t ofs1;
289+
uint64_t ofs0;
290+
uint64_t ofs1;
291291
int32_t IW;
292292
int32_t IH;
293293
int32_t CHW;

ggml/src/ggml-metal/ggml-metal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3278,8 +3278,8 @@ static void ggml_metal_encode_node(
32783278

32793279
const int32_t CHW = IC * KH * KW;
32803280

3281-
const int32_t ofs0 = src1->nb[is_2D ? 3 : 2] / 4;
3282-
const int32_t ofs1 = src1->nb[is_2D ? 2 : 1] / 4;
3281+
const uint64_t ofs0 = src1->nb[is_2D ? 3 : 2] / 4;
3282+
const uint64_t ofs1 = src1->nb[is_2D ? 2 : 1] / 4;
32833283

32843284
id<MTLComputePipelineState> pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_IM2COL_F32].pipeline;
32853285

0 commit comments

Comments
 (0)