@@ -255,39 +255,6 @@ mkl_umath_@TYPE@_sqrt(char **args, const npy_intp *dimensions, const npy_intp *s
255
255
256
256
/**end repeat**/
257
257
258
- /**begin repeat
259
- * Float types
260
- * #type = npy_float, npy_double#
261
- * #TYPE = FLOAT, DOUBLE#
262
- * #c = s, d#
263
- * #scalarf = (1.0f)/sqrtf, (1.0)/sqrt#
264
- */
265
-
266
- void
267
- mkl_umath_@TYPE@_invsqrt(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
268
- {
269
- const int contig = IS_UNARY_CONT(@type@, @type@);
270
- const int disjoint_or_same = DISJOINT_OR_SAME(args[0], args[1], dimensions[0], sizeof(@type@));
271
- const int can_vectorize = contig && disjoint_or_same;
272
-
273
- if(can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD)
274
- {
275
- CHUNKED_VML_CALL2(v@c@InvSqrt, dimensions[0], @type@, args[0], args[1]);
276
- /* v@c@InvSqrt(dimensions[0], (@type@*) args[0], (@type@*) args[1]); */
277
- } else {
278
- UNARY_LOOP_DISPATCH(
279
- @type@, @type@
280
- ,
281
- can_vectorize
282
- ,
283
- const @type@ in1 = *(@type@ *)ip1;
284
- *(@type@ *)op1 = @scalarf@(in1);
285
- )
286
- }
287
- }
288
-
289
- /**end repeat**/
290
-
291
258
/**begin repeat
292
259
* Float types
293
260
* #type = npy_float, npy_double#
@@ -400,39 +367,6 @@ mkl_umath_@TYPE@_expm1(char **args, const npy_intp *dimensions, const npy_intp *
400
367
401
368
/**end repeat**/
402
369
403
- /**begin repeat
404
- * Float types
405
- * #type = npy_float, npy_double#
406
- * #TYPE = FLOAT, DOUBLE#
407
- * #c = s, d#
408
- * #scalarf = erff, erf#
409
- */
410
-
411
- void
412
- mkl_umath_@TYPE@_erf(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
413
- {
414
- const int contig = IS_UNARY_CONT(@type@, @type@);
415
- const int disjoint_or_same = DISJOINT_OR_SAME(args[0], args[1], dimensions[0], sizeof(@type@));
416
- const int can_vectorize = contig && disjoint_or_same;
417
-
418
- if( can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD)
419
- {
420
- CHUNKED_VML_CALL2(v@c@Erf, dimensions[0], @type@, args[0], args[1]);
421
- /* v@c@Erf(dimensions[0], (@type@*) args[0], (@type@*) args[1]); */
422
- } else {
423
- UNARY_LOOP_DISPATCH(
424
- @type@, @type@
425
- ,
426
- can_vectorize
427
- ,
428
- const @type@ in1 = *(@type@ *)ip1;
429
- *(@type@ *)op1 = @scalarf@(in1);
430
- )
431
- }
432
- }
433
-
434
- /**end repeat**/
435
-
436
370
/**begin repeat
437
371
* Float types
438
372
* #type = npy_float, npy_double#
@@ -2189,14 +2123,6 @@ mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_i
2189
2123
}
2190
2124
}
2191
2125
2192
- void
2193
- mkl_umath_@TYPE@__ones_like(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data))
2194
- {
2195
- OUTPUT_LOOP {
2196
- *((@type@ *)op1) = 1;
2197
- }
2198
- }
2199
-
2200
2126
void
2201
2127
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
2202
2128
{
@@ -2351,8 +2277,6 @@ mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_i
2351
2277
}
2352
2278
#endif
2353
2279
2354
- #define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
2355
-
2356
2280
/**end repeat**/
2357
2281
2358
2282
/*
@@ -2651,15 +2575,6 @@ mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_i
2651
2575
}
2652
2576
}
2653
2577
2654
- void
2655
- mkl_umath_@TYPE@__ones_like(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data))
2656
- {
2657
- OUTPUT_LOOP {
2658
- ((@ftype@ *)op1)[0] = 1;
2659
- ((@ftype@ *)op1)[1] = 0;
2660
- }
2661
- }
2662
-
2663
2578
void
2664
2579
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) {
2665
2580
const int contig = IS_UNARY_CONT(@type@, @type@);
@@ -2679,6 +2594,36 @@ mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_in
2679
2594
}
2680
2595
}
2681
2596
2597
+ void
2598
+ mkl_umath_@TYPE@_exp(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
2599
+ {
2600
+ const int contig = IS_UNARY_CONT(@type@, @type@);
2601
+ const int disjoint_or_same = DISJOINT_OR_SAME(args[0], args[1], dimensions[0], sizeof(@type@));
2602
+ const int can_vectorize = contig && disjoint_or_same;
2603
+ int ignore_fpstatus = 0;
2604
+
2605
+ if(can_vectorize && dimensions[0] > VML_TRANSCEDENTAL_THRESHOLD)
2606
+ {
2607
+ ignore_fpstatus = 1;
2608
+ CHUNKED_VML_CALL2(v@s@Exp, dimensions[0], @type@, args[0], args[1]);
2609
+ /* v@s@Exp(dimensions[0], (@type@*) args[0], (@type@*) args[1]); */
2610
+ } else {
2611
+ UNARY_LOOP_DISPATCH(
2612
+ @type@, @type@
2613
+ ,
2614
+ can_vectorize
2615
+ ,
2616
+ const @type@ in1 = *(@type@ *)ip1;
2617
+ const int invalid_cases = npy_isnan(in1) || in1 == NPY_INFINITY || in1 == -NPY_INFINITY;
2618
+ ignore_fpstatus |= invalid_cases;
2619
+ *(@type@ *)op1 = cexp@c@(in1);
2620
+ )
2621
+ }
2622
+ if(ignore_fpstatus) {
2623
+ feclearexcept(FE_INVALID);
2624
+ }
2625
+ }
2626
+
2682
2627
void
2683
2628
mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
2684
2629
{
@@ -2703,16 +2648,6 @@ mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_int
2703
2648
}
2704
2649
}
2705
2650
2706
- void
2707
- mkl_umath_@TYPE@__arg(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
2708
- {
2709
- UNARY_LOOP {
2710
- const @ftype@ in1r = ((@ftype@ *)ip1)[0];
2711
- const @ftype@ in1i = ((@ftype@ *)ip1)[1];
2712
- *((@ftype@ *)op1) = atan2@c@(in1i, in1r);
2713
- }
2714
- }
2715
-
2716
2651
void
2717
2652
mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
2718
2653
{
@@ -2812,8 +2747,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp
2812
2747
}
2813
2748
/**end repeat1**/
2814
2749
2815
- #define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
2816
-
2817
2750
/**end repeat**/
2818
2751
2819
2752
#undef CGE
0 commit comments