|
28 | 28 | #include <immintrin.h> |
29 | 29 | #endif |
30 | 30 |
|
31 | | -#if defined(GGML_VXE) |
32 | | -#include <vecintrin.h> |
33 | | -#include <ggml-cpu/ggml-cpu-impl.h> |
34 | | -#endif |
35 | | - |
36 | | -#if defined(GGML_NNPA) |
37 | | -#ifndef __NNPA__ |
38 | | -#define __NNPA__ |
39 | | -#endif // __NNPA__ |
40 | | -#endif // GGML_NNPA |
41 | | - |
42 | 31 | #ifdef __cplusplus |
43 | 32 | extern "C" { |
44 | 33 | #endif |
@@ -429,6 +418,19 @@ GGML_API void ggml_aligned_free(void * ptr, size_t size); |
429 | 418 | #define GGML_FP32_TO_FP16(x) GGML_COMPUTE_FP32_TO_FP16(x) |
430 | 419 |
|
431 | 420 | #elif defined(__NNPA__) |
| 421 | + /* |
| 422 | + * Note: This functionality is ready for use, but the compiler macros |
| 423 | + * defined for the s390x platform are defined in ggml-cpu while |
| 424 | + * this file is 1 step behind, in ggml-src. I currently have no |
| 425 | + * idea how to fix this, so I am leaving it as is. |
| 426 | + * |
| 427 | + * CMake chain: ggml -> ggml-src -> ggml-cpu |
| 428 | + * ^^^^^^^^ ^^^^^^^^ |
| 429 | + * | | ggml-cpu defines the macros |
| 430 | + * | | needed for s390x detection. |
| 431 | + * | this file is here, where the s390x |
| 432 | + * | detection macros are not defined. |
| 433 | + */ |
432 | 434 |
|
433 | 435 | #define GGML_COMPUTE_FP16_TO_FP32(x) ggml_compute_fp16_to_fp32(x) |
434 | 436 | #define GGML_COMPUTE_FP32_TO_FP16(x) ggml_compute_fp32_to_fp16(x) |
@@ -474,12 +476,6 @@ GGML_API void ggml_aligned_free(void * ptr, size_t size); |
474 | 476 | } |
475 | 477 |
|
476 | 478 | static inline float ggml_compute_fp16_to_fp32(ggml_fp16_t h) { |
477 | | - #ifdef __NNPA__ |
478 | | - printf("%s: __NNPA__ is defined.\n", __func__); |
479 | | - #else |
480 | | - printf("%s: __NNPA__ is not defined.\n", __func__); |
481 | | - #endif |
482 | | - |
483 | 479 | const uint32_t w = (uint32_t) h << 16; |
484 | 480 | const uint32_t sign = w & UINT32_C(0x80000000); |
485 | 481 | const uint32_t two_w = w + w; |
|
0 commit comments