|
2 | 2 | // SPDX-FileCopyrightText: Copyright the Vortex contributors |
3 | 3 |
|
4 | 4 | #include <cuda.h> |
5 | | -#include <cuda_fp16.h> |
6 | 5 | #include <cuda_runtime.h> |
7 | 6 | #include <stdint.h> |
8 | 7 |
|
@@ -39,30 +38,13 @@ extern "C" __global__ void dict_##value_suffix##_##index_suffix( \ |
39 | 38 | dict_kernel<ValueType, IndexType>(codes, codes_len, values, output); \ |
40 | 39 | } |
41 | 40 |
|
42 | | -// Generate for all combinations of value types and index types |
43 | | -// Value types: u8, i8, u16, i16, u32, i32, u64, i64 |
44 | | -// Index types: u8, u16, u32, u64 (codes are typically unsigned) |
45 | | - |
46 | | -#define GENERATE_DICT_KERNELS_FOR_VALUE(value_suffix, ValueType) \ |
| 41 | +// Generate dict kernel for all index types (unsigned integers) for a given value type |
| 42 | +#define GENERATE_DICT_FOR_ALL_INDICES(value_suffix, ValueType) \ |
47 | 43 | GENERATE_DICT_KERNEL(value_suffix, ValueType, u8, uint8_t) \ |
48 | 44 | GENERATE_DICT_KERNEL(value_suffix, ValueType, u16, uint16_t) \ |
49 | 45 | GENERATE_DICT_KERNEL(value_suffix, ValueType, u32, uint32_t) \ |
50 | 46 | GENERATE_DICT_KERNEL(value_suffix, ValueType, u64, uint64_t) |
51 | 47 |
|
52 | | -GENERATE_DICT_KERNELS_FOR_VALUE(u8, uint8_t) |
53 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i8, int8_t) |
54 | | -GENERATE_DICT_KERNELS_FOR_VALUE(u16, uint16_t) |
55 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i16, int16_t) |
56 | | -GENERATE_DICT_KERNELS_FOR_VALUE(u32, uint32_t) |
57 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i32, int32_t) |
58 | | -GENERATE_DICT_KERNELS_FOR_VALUE(u64, uint64_t) |
59 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i64, int64_t) |
60 | | - |
61 | | -// Float types |
62 | | -GENERATE_DICT_KERNELS_FOR_VALUE(f16, __half) |
63 | | -GENERATE_DICT_KERNELS_FOR_VALUE(f32, float) |
64 | | -GENERATE_DICT_KERNELS_FOR_VALUE(f64, double) |
| 48 | +// Generate for all native ptypes & decimal values |
| 49 | +FOR_EACH_NUMERIC(GENERATE_DICT_FOR_ALL_INDICES) |
65 | 50 |
|
66 | | -// Decimal types (128-bit and 256-bit) |
67 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i128, int128_t) |
68 | | -GENERATE_DICT_KERNELS_FOR_VALUE(i256, int256_t) |
0 commit comments