File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ typedef uint32_t ggml_half2;
12
12
#elif defined(GGML_COMMON_DECL_METAL)
13
13
#include < metal_stdlib>
14
14
15
- typedef half ggml_half;
16
- typedef half2 ggml_half2;
15
+ typedef half ggml_half;
16
+ typedef half2 ggml_half2;
17
17
18
18
#define GGML_COMMON_AGGR
19
19
@@ -22,8 +22,18 @@ typedef half2 ggml_half2;
22
22
#include < cuda_fp16.h>
23
23
#include < cstdint>
24
24
25
- typedef half ggml_half;
26
- typedef half2 ggml_half2;
25
+ typedef half ggml_half;
26
+ typedef half2 ggml_half2;
27
+
28
+ #define GGML_COMMON_AGGR data
29
+
30
+ #define GGML_COMMON_DECL
31
+ #elif defined(GGML_COMMON_DECL_HIP)
32
+ #include < hip/hip_fp16.h>
33
+ #include < cstdint>
34
+
35
+ typedef half ggml_half;
36
+ typedef half2 ggml_half2;
27
37
28
38
#define GGML_COMMON_AGGR data
29
39
@@ -373,7 +383,7 @@ static_assert(sizeof(block_iq4_xs) == sizeof(ggml_half) + sizeof(uint16_t) + QK_
373
383
#define GGML_TABLE_END () };
374
384
375
385
#define GGML_COMMON_IMPL
376
- #elif defined(GGML_COMMON_IMPL_CUDA)
386
+ #elif defined(GGML_COMMON_IMPL_CUDA) || defined(GGML_COMMON_IMPL_HIP)
377
387
#include < cstdint>
378
388
379
389
#define GGML_TABLE_BEGIN (type, name, size ) static const __device__ __constant__ type name[size] = {
Original file line number Diff line number Diff line change 2
2
#include " ggml.h"
3
3
#include " ggml-backend-impl.h"
4
4
5
+ #if defined(GGML_USE_HIPBLAS)
6
+ #define GGML_COMMON_DECL_HIP
7
+ #define GGML_COMMON_IMPL_HIP
8
+ #else
5
9
#define GGML_COMMON_DECL_CUDA
6
10
#define GGML_COMMON_IMPL_CUDA
11
+ #endif
7
12
#include " ggml-common.h"
8
13
9
14
#include < algorithm>
You can’t perform that action at this time.
0 commit comments