Skip to content

Commit 0084847

Browse files
committed
apply suggestions
Signed-off-by: Junhee Yoo <[email protected]>
1 parent e81462d commit 0084847

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

ggml/src/ggml-metal.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ static void ggml_backend_metal_device_rel(struct ggml_backend_metal_device_conte
274274
GGML_METAL_KERNEL_TYPE_SIN,
275275
GGML_METAL_KERNEL_TYPE_COS,
276276
GGML_METAL_KERNEL_TYPE_SUM_ROWS,
277-
GGML_METAL_KERNEL_TYPE_AVG_POOL_2D_F32,
278-
GGML_METAL_KERNEL_TYPE_MAX_POOL_2D_F32,
277+
GGML_METAL_KERNEL_TYPE_POOL_2D_AVG_F32,
278+
GGML_METAL_KERNEL_TYPE_POOL_2D_MAX_F32,
279279

280280
GGML_METAL_KERNEL_TYPE_COUNT
281281
};
@@ -722,8 +722,8 @@ @implementation GGMLMetalClass
722722
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_SIN, sin, true);
723723
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_COS, cos, true);
724724
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_SUM_ROWS, sum_rows, true);
725-
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_AVG_POOL_2D_F32, avg_pool_2d_f32, true);
726-
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_MAX_POOL_2D_F32, max_pool_2d_f32, true);
725+
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_POOL_2D_AVG_F32, avg_pool_2d_f32, true);
726+
GGML_METAL_ADD_KERNEL(GGML_METAL_KERNEL_TYPE_POOL_2D_MAX_F32, max_pool_2d_f32, true);
727727
}
728728

729729
[metal_library release];
@@ -3044,9 +3044,9 @@ static void ggml_metal_encode_node(
30443044
case GGML_TYPE_F32: {
30453045
switch(op) {
30463046
case GGML_OP_POOL_AVG:
3047-
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_AVG_POOL_2D_F32].pipeline; break;
3047+
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_POOL_2D_AVG_F32].pipeline; break;
30483048
case GGML_OP_POOL_MAX:
3049-
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_MAX_POOL_2D_F32].pipeline; break;
3049+
pipeline = ctx->kernels[GGML_METAL_KERNEL_TYPE_POOL_2D_MAX_F32].pipeline; break;
30503050
default: GGML_ASSERT(false && "not implemented");
30513051
}
30523052
} break;

ggml/src/ggml-metal.metal

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,19 +6453,19 @@ template [[host_name("kernel_mul_mv_id_iq4_nl_f32")]] kernel kernel_mul_mv_id_t
64536453
template [[host_name("kernel_mul_mv_id_iq4_xs_f32")]] kernel kernel_mul_mv_id_t kernel_mul_mv_id<mmv_fn<kernel_mul_mv_iq4_xs_f32_impl>>;
64546454

64556455
kernel void kernel_max_pool_2d_f32(
6456-
device const float* src0,
6457-
device float* dst,
6458-
constant int32_t& k0,
6459-
constant int32_t& k1,
6460-
constant int32_t& s0,
6461-
constant int32_t& s1,
6462-
constant int32_t& p0,
6463-
constant int32_t& p1,
6464-
constant int64_t& IH,
6465-
constant int64_t& IW,
6466-
constant int64_t& OH,
6467-
constant int64_t& OW,
6468-
constant int64_t& parallel_elements,
6456+
device const float * src0,
6457+
device float * dst,
6458+
constant int32_t & k0,
6459+
constant int32_t & k1,
6460+
constant int32_t & s0,
6461+
constant int32_t & s1,
6462+
constant int32_t & p0,
6463+
constant int32_t & p1,
6464+
constant int64_t & IH,
6465+
constant int64_t & IW,
6466+
constant int64_t & OH,
6467+
constant int64_t & OW,
6468+
constant int64_t & parallel_elements,
64696469
uint gid[[thread_position_in_grid]]) {
64706470

64716471
if (gid >= parallel_elements) {

0 commit comments

Comments
 (0)