Skip to content

Commit d627812

Browse files
committed
fix compilation errors
1 parent 286519d commit d627812

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

ggml/src/ggml-cpu/arch/arm/quants.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ void quantize_row_q8_1(const float * GGML_RESTRICT x, void * GGML_RESTRICT vy, i
129129
#endif
130130
}
131131

132+
// placeholder implementation for Apple targets
133+
void quantize_row_q8_K(const float * GGML_RESTRICT x, void * GGML_RESTRICT y, int64_t k) {
134+
quantize_row_q8_K_ref(x, y, k);
135+
}
132136

133137
//===================================== Dot products =================================
134138

ggml/src/ggml-cpu/arch/x86/quants.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ void quantize_row_q8_1(const float * GGML_RESTRICT x, void * GGML_RESTRICT vy, i
477477
#endif
478478
}
479479

480+
// placeholder implementation for Apple targets
481+
void quantize_row_q8_K(const float * GGML_RESTRICT x, void * GGML_RESTRICT y, int64_t k) {
482+
quantize_row_q8_K_ref(x, y, k);
483+
}
480484

481485
//===================================== Dot products =================================
482486

ggml/src/ggml-cpu/ggml-cpu-impl.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,11 @@ void ggml_barrier(struct ggml_threadpool * tp);
509509

510510
#define GGML_DO_PRAGMA_(x) _Pragma (#x)
511511
#define GGML_DO_PRAGMA(x) GGML_DO_PRAGMA_(x)
512-
#if defined(GGML_CPU_GENERIC) || defined(__HIPCC__)
513-
// weak alias not working
512+
#if defined(GGML_CPU_GENERIC) || defined(__HIPCC__) || defined(__APPLE__)
513+
// Note for Apple targets:
514+
// - clang: aliases are not supported on darwin
515+
// - all native kernels need to be implemented in both x86 and arm files
516+
// - on iOS, tvOS, and visionOS, if cmake cannot determine the target architecture, all `_generic` names are replaced by defines
514517
# define GGML_WEAK_ALIAS(name, alias)
515518
#elif defined(__GNUC__)
516519
// GCC/Clang on *nix

ggml/src/ggml-cuda/common.cuh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ static __device__ __forceinline__ int ggml_cuda_dp4a(const int a, const int b, i
466466
#endif // defined(GGML_USE_HIP) && defined(__HIP_PLATFORM_AMD__)
467467
}
468468

469-
// TODO: move to ggml-common.h
470-
static constexpr __device__ int8_t kvalues_iq4nl[16] = {-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113};
471-
472469
typedef void (*dequantize_kernel_t)(const void * vx, const int64_t ib, const int iqs, dfloat2 & v);
473470

474471
static __device__ __forceinline__ float get_alibi_slope(

ggml/src/ggml-sycl/common.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ typedef sycl::float2 dfloat2;
149149

150150
#define MMVQ_MAX_BATCH_SIZE 8
151151

152-
static const int8_t kvalues_iq4nl[16]={-127, -104, -83, -65, -49, -35, -22, -10, 1, 13, 25, 38, 53, 69, 89, 113};
153-
154152
static int g_all_sycl_device_count = -1;
155153
static bool g_ggml_backend_sycl_buffer_type_initialized = false;
156154

0 commit comments

Comments
 (0)