|
| 1 | +/** |
| 2 | + * See file LICENSE for terms. |
| 3 | + */ |
| 4 | + |
| 5 | +#include <ucs/datastruct/ndim_knn.h> |
| 6 | + |
| 7 | +#define EXPORTED __attribute__((visibility("protected"))) |
| 8 | +#define DIM_LIST 1, 2, 3, 16, 20, 25, 50, 96, 100, 128, 200, 256, 784, 800, 960 |
| 9 | + |
| 10 | +#define WNN_BY_DIM(_K, _ndim) \ |
| 11 | + NDIM_WNN_INIT2(char_to_unsigned_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 12 | + char, unsigned, khint32_t, kh_int_hash_func, \ |
| 13 | + kh_int_hash_equal, kh_int_hash_func, kh_int_hash_equal) \ |
| 14 | + NDIM_WNN_INIT2(int32_to_int32_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 15 | + khint32_t, unsigned, khint32_t, kh_int_hash_func, \ |
| 16 | + kh_int_hash_equal, kh_int_hash_func, kh_int_hash_equal) \ |
| 17 | + NDIM_WNN_INIT2(int64_to_int64_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 18 | + khint64_t, khint64_t, khint64_t, kh_int_hash_func, \ |
| 19 | + kh_int_hash_equal, kh_int64_hash_func, kh_int64_hash_equal) \ |
| 20 | + NDIM_WNN_INIT2(float_to_unsigned_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 21 | + float, unsigned, int, kh_int_hash_func, kh_int_hash_equal, \ |
| 22 | + kh_int_hash_func, kh_int_hash_equal) \ |
| 23 | + NDIM_WNN_INIT2(float_to_ptr_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 24 | + float, uintptr_t, float, kh_int_hash_func, kh_int_hash_equal, \ |
| 25 | + kh_int64_hash_func, kh_int64_hash_equal) \ |
| 26 | + NDIM_WNN_INIT2(cstr_to_ptr_##_ndim##_dim_k##_K, _K, _ndim, EXPORTED, \ |
| 27 | + kh_cstr_t, unsigned, float, kh_str_hash_func, \ |
| 28 | + kh_str_hash_equal, kh_int_hash_func, kh_int_hash_equal) |
| 29 | + |
| 30 | +UCS_PP_FOREACH(WNN_BY_DIM, 1, DIM_LIST) |
| 31 | +UCS_PP_FOREACH(WNN_BY_DIM, 10, DIM_LIST) |
0 commit comments