|
73 | 73 |
|
74 | 74 | #define MKL_INT_MAX ((npy_intp) ((~((MKL_UINT) 0)) >> 1)) |
75 | 75 |
|
76 | | -#define CHUNKED_VML_CALL2(vml_func, n, type, mkl_type, mkl_op_type, in1, op1) \ |
| 76 | +#define CHUNKED_VML_CALL2(vml_func, n, type, mkl_type, mkl_ftype, in1, op1) \ |
77 | 77 | do { \ |
78 | 78 | npy_intp _n_ = (n); \ |
79 | 79 | const npy_intp _chunk_size = MKL_INT_MAX; \ |
|
82 | 82 | while (_n_ > 0) { \ |
83 | 83 | npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \ |
84 | 84 | vml_func((MKL_INT) _current_chunk, (mkl_type *)(void *) in1p, \ |
85 | | - (mkl_op_type *)(void *) op1p); \ |
| 85 | + (mkl_ftype *)(void *) op1p); \ |
86 | 86 | _n_ -= _current_chunk; \ |
87 | 87 | in1p += _current_chunk; \ |
88 | 88 | op1p += _current_chunk; \ |
@@ -1191,7 +1191,7 @@ mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_i |
1191 | 1191 | * #ftype = npy_float, npy_double# |
1192 | 1192 | * #type = npy_cfloat, npy_cdouble# |
1193 | 1193 | * #mkl_type = MKL_Complex8, MKL_Complex16# |
1194 | | - * #mkl_op_type = float, double# |
| 1194 | + * #mkl_ftype = float, double# |
1195 | 1195 | * #c = f, # |
1196 | 1196 | * #C = F, # |
1197 | 1197 | * #s = c, z# |
@@ -1515,18 +1515,27 @@ mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_in |
1515 | 1515 | } |
1516 | 1516 | } |
1517 | 1517 |
|
| 1518 | +/**begin repeat |
| 1519 | + * complex types |
| 1520 | + * #TYPE = CFLOAT, CDOUBLE# |
| 1521 | + * #ftype = npy_float, npy_double# |
| 1522 | + * #type = npy_cfloat, npy_cdouble# |
| 1523 | + * #mkl_ftype = float, double# |
| 1524 | + * #mkl_type = MKL_Complex8, MKL_Complex16# |
| 1525 | + |
| 1526 | + */ |
1518 | 1527 | void |
1519 | 1528 | mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) |
1520 | 1529 | { |
1521 | | - const int contig = IS_UNARY_CONT(@mkl_type@, @mkl_op_type@); |
| 1530 | + const int contig = IS_UNARY_CONT(@mkl_type@, @mkl_ftype@); |
1522 | 1531 | const int disjoint_or_same = DISJOINT_OR_SAME_TWO_DTYPES(args[0], args[1], dimensions[0], sizeof(@type@), sizeof(@ftype@)); |
1523 | 1532 | const int can_vectorize = contig && disjoint_or_same; |
1524 | 1533 | int ignore_fpstatus = 0; |
1525 | 1534 |
|
1526 | 1535 | if (can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD) { |
1527 | 1536 | ignore_fpstatus = 1; |
1528 | | - CHUNKED_VML_CALL2(v@s@Abs, dimensions[0], @type@, @mkl_type@, @mkl_op_type@, args[0], args[1]); |
1529 | | - /* v@s@Abs(dimensions[0], (@mkl_type@*) args[0], (@mkl_op_type@*) args[1]); */ |
| 1537 | + CHUNKED_VML_CALL2(v@s@Abs, dimensions[0], @type@, @mkl_type@, @mkl_ftype@, args[0], args[1]); |
| 1538 | + /* v@s@Abs(dimensions[0], (@mkl_type@*) args[0], (@mkl_ftype@*) args[1]); */ |
1530 | 1539 | } |
1531 | 1540 | else { |
1532 | 1541 | UNARY_LOOP { |
|
0 commit comments