You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

bf16dot.c 957 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <stdio.h>
  2. #include "common.h"
  3. #ifdef FUNCTION_PROFILE
  4. #include "functable.h"
  5. #endif
  6. #ifndef CBLAS
  7. float NAME(blasint *N, bfloat16 *x, blasint *INCX, bfloat16 *y, blasint *INCY){
  8. BLASLONG n = *N;
  9. BLASLONG incx = *INCX;
  10. BLASLONG incy = *INCY;
  11. float ret;
  12. PRINT_DEBUG_NAME;
  13. if (n <= 0) return 0.;
  14. IDEBUG_START;
  15. FUNCTION_PROFILE_START();
  16. if (incx < 0) x -= (n - 1) * incx;
  17. if (incy < 0) y -= (n - 1) * incy;
  18. ret = BF16_DOT_K(n, x, incx, y, incy);
  19. FUNCTION_PROFILE_END(1, 2 * n, 2 * n);
  20. IDEBUG_END;
  21. return ret;
  22. }
  23. #else
  24. float CNAME(blasint n, bfloat16 *x, blasint incx, bfloat16 *y, blasint incy){
  25. float ret;
  26. PRINT_DEBUG_CNAME;
  27. if (n <= 0) return 0.;
  28. IDEBUG_START;
  29. FUNCTION_PROFILE_START();
  30. if (incx < 0) x -= (n - 1) * incx;
  31. if (incy < 0) y -= (n - 1) * incy;
  32. ret = BF16_DOT_K(n, x, incx, y, incy);
  33. FUNCTION_PROFILE_END(1, 2 * n, 2 * n);
  34. IDEBUG_END;
  35. return ret;
  36. }
  37. #endif