Skip to content

Commit 9beea76

Browse files
committed
remove unused functions (#87)
1 parent 35efea5 commit 9beea76

File tree

3 files changed

+33
-128
lines changed

3 files changed

+33
-128
lines changed

mkl_umath/generate_umath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def english_upper(s):
646646
Ufunc(1, 1, None,
647647
docstrings.get('numpy._core.umath.exp'),
648648
None,
649-
TD(inexactvec),
649+
TD(inexactvec + cmplxvec),
650650
),
651651
'exp2':
652652
Ufunc(1, 1, None,

mkl_umath/src/mkl_umath_loops.c.src

Lines changed: 30 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -255,39 +255,6 @@ mkl_umath_@TYPE@_sqrt(char **args, const npy_intp *dimensions, const npy_intp *s
255255

256256
/**end repeat**/
257257

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-
291258
/**begin repeat
292259
* Float types
293260
* #type = npy_float, npy_double#
@@ -400,39 +367,6 @@ mkl_umath_@TYPE@_expm1(char **args, const npy_intp *dimensions, const npy_intp *
400367

401368
/**end repeat**/
402369

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-
436370
/**begin repeat
437371
* Float types
438372
* #type = npy_float, npy_double#
@@ -2189,14 +2123,6 @@ mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_i
21892123
}
21902124
}
21912125

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-
22002126
void
22012127
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
22022128
{
@@ -2351,8 +2277,6 @@ mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_i
23512277
}
23522278
#endif
23532279

2354-
#define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
2355-
23562280
/**end repeat**/
23572281

23582282
/*
@@ -2651,15 +2575,6 @@ mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_i
26512575
}
26522576
}
26532577

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-
26632578
void
26642579
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func)) {
26652580
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
26792594
}
26802595
}
26812596

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+
26822627
void
26832628
mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
26842629
{
@@ -2703,16 +2648,6 @@ mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_int
27032648
}
27042649
}
27052650

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-
27162651
void
27172652
mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func))
27182653
{
@@ -2812,8 +2747,6 @@ mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp
28122747
}
28132748
/**end repeat1**/
28142749

2815-
#define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
2816-
28172750
/**end repeat**/
28182751

28192752
#undef CGE

mkl_umath/src/mkl_umath_loops.h.src

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ MKL_UMATH_API
5757
void
5858
mkl_umath_@TYPE@_sqrt(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
5959

60-
MKL_UMATH_API
61-
void
62-
mkl_umath_@TYPE@_invsqrt(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
63-
6460
MKL_UMATH_API
6561
void
6662
mkl_umath_@TYPE@_exp(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
@@ -73,10 +69,6 @@ MKL_UMATH_API
7369
void
7470
mkl_umath_@TYPE@_expm1(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
7571

76-
MKL_UMATH_API
77-
void
78-
mkl_umath_@TYPE@_erf(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
79-
8072
MKL_UMATH_API
8173
void
8274
mkl_umath_@TYPE@_log(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
@@ -221,10 +213,6 @@ void
221213
mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
222214
/**end repeat1**/
223215

224-
MKL_UMATH_API
225-
void
226-
mkl_umath_@TYPE@_floor_divide(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
227-
228216
MKL_UMATH_API
229217
void
230218
mkl_umath_@TYPE@_remainder(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
@@ -241,10 +229,6 @@ MKL_UMATH_API
241229
void
242230
mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
243231

244-
MKL_UMATH_API
245-
void
246-
mkl_umath_@TYPE@__ones_like(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
247-
248232
MKL_UMATH_API
249233
void
250234
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
@@ -287,8 +271,6 @@ void
287271
mkl_umath_@TYPE@_ldexp_long(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
288272
#endif
289273

290-
#define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
291-
292274
/**end repeat**/
293275

294276
/*
@@ -326,10 +308,6 @@ MKL_UMATH_API
326308
void
327309
mkl_umath_@TYPE@_divide(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
328310

329-
MKL_UMATH_API
330-
void
331-
mkl_umath_@TYPE@_floor_divide(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
332-
333311

334312
/**begin repeat1
335313
* arithmetic
@@ -350,10 +328,6 @@ MKL_UMATH_API
350328
void
351329
mkl_umath_@TYPE@_reciprocal(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
352330

353-
MKL_UMATH_API
354-
void
355-
mkl_umath_@TYPE@__ones_like(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
356-
357331
MKL_UMATH_API
358332
void
359333
mkl_umath_@TYPE@_conjugate(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
@@ -364,11 +338,11 @@ mkl_umath_@TYPE@_absolute(char **args, const npy_intp *dimensions, const npy_int
364338

365339
MKL_UMATH_API
366340
void
367-
mkl_umath_@TYPE@__arg(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
341+
mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
368342

369343
MKL_UMATH_API
370344
void
371-
mkl_umath_@TYPE@_sign(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(data));
345+
mkl_umath_@TYPE@_exp(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
372346

373347
/**begin repeat1
374348
* arithmetic
@@ -379,8 +353,6 @@ void
379353
mkl_umath_@TYPE@_@kind@(char **args, const npy_intp *dimensions, const npy_intp *steps, void *NPY_UNUSED(func));
380354
/**end repeat1**/
381355

382-
#define mkl_umath_@TYPE@_true_divide mkl_umath_@TYPE@_divide
383-
384356
/**end repeat**/
385357

386358
#undef CGE

0 commit comments

Comments
 (0)