implement std::isinf for icpx with fast math.
This commit is contained in:
parent
05b7f9be6f
commit
d6a6505018
1 changed files with 8 additions and 1 deletions
|
@ -240,10 +240,17 @@ static std::string var_to_str(ggml_type type) {
|
||||||
#define VARS_TO_STR10(a, b, c, d, e, f, g, h, i, j) VAR_TO_STR(a) + "," + VARS_TO_STR9(b, c, d, e, f, g, h, i, j)
|
#define VARS_TO_STR10(a, b, c, d, e, f, g, h, i, j) VAR_TO_STR(a) + "," + VARS_TO_STR9(b, c, d, e, f, g, h, i, j)
|
||||||
#define VARS_TO_STR11(a, b, c, d, e, f, g, h, i, j, k) VAR_TO_STR(a) + "," + VARS_TO_STR10(b, c, d, e, f, g, h, i, j, k)
|
#define VARS_TO_STR11(a, b, c, d, e, f, g, h, i, j, k) VAR_TO_STR(a) + "," + VARS_TO_STR10(b, c, d, e, f, g, h, i, j, k)
|
||||||
|
|
||||||
|
#ifdef GGML_USE_SYCL
|
||||||
|
static bool inline _isinf(float f) {
|
||||||
|
return (*(uint32_t *)&f & 0x7fffffff) == 0x7f800000;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static bool inline _isinf(float f) { return std::isinf(f); }
|
||||||
|
#endif
|
||||||
|
|
||||||
// accept FLT_MAX as infinity
|
// accept FLT_MAX as infinity
|
||||||
static bool isinf_or_max(float f) {
|
static bool isinf_or_max(float f) {
|
||||||
return std::isinf(f) || f == FLT_MAX || f == -FLT_MAX;
|
return _isinf(f) || f == FLT_MAX || f == -FLT_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ggml_is_view_op(enum ggml_op op) {
|
static bool ggml_is_view_op(enum ggml_op op) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue