common.h 603 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // See LICENSE for license details.
  2. #ifndef _MM_H
  3. #define _MM_H
  4. #include <string.h>
  5. #include <stdint.h>
  6. #include <math.h>
  7. #ifdef SP
  8. typedef float t;
  9. #define fma fmaf
  10. #else
  11. typedef double t;
  12. #endif
  13. #define inline inline __attribute__((always_inline))
  14. #define alloca_aligned(s, a) ((void*)(((uintptr_t)alloca((s)+(a)-1)+(a)-1)&~((a)-1)))
  15. #include "rb.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. void mm(size_t m, size_t n, size_t p,
  20. t* a, size_t lda, t* b, size_t ldb, t* c, size_t ldc);
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. //void rb(t* a, t* b, t* c, size_t lda, size_t ldb, size_t ldc);
  25. #endif