Commit 52162af
authored
MAINT: simplify power fast path logic (numpy#27901)
* MAINT: remove fast paths from array power
* MAINT: Add fast paths to power loops
* MAINT: Clean loops for integer power in umath
* MAINT: Remove blocking regression test for power fast paths
* MAINT: Add helper function for power fast paths
* BUG: Change misspelled bitwise and to logical and
* BUG: Fix missing value on power helper return
* BUG: Fix exponent bitwise logic in power fast paths
* MAINT: Add power fast paths to floating point umath
* MAINT: Add fast power paths to array power when exponent is python object
* MAINT: Fix division by zero runtime warning in test regression
* MAINT: Adapt object regression test for linalg to power fast paths
* MAINT: Remove incorrect declarations in power fast paths
* MAINT: Reduce calls to power fast path helper when scalar is ineligible
* MAINT: Fix missing sliding loop
* BUG: Fix syntax error
* MAINT: Fix semantic misuse of -1 for non-error returns
* MAINT: Improve error checking in power fast paths to remove PyErr_Clear
* MAINT: Improve type checking in power fast paths
* MAINT: Efficient handling of ones arrays in scalar fast paths
* MAINT: Simplify outer check for scalar power fast paths
* MAINT: Reduce code reuse in float power fast paths and add reciprocal
* MAINT: Remove Python scalar checking for fast power paths
* MAINT: Add benchmarks for power operators in float binary bench
* MAINT: Add scalar power fast paths
* BUG: Add missing pointer cast
* BUG: Allow scalar power fast paths only for non-integers
* MAINT: Restore outdated changes in regression test to master1 parent 1d77082 commit 52162af
File tree
5 files changed
+105
-192
lines changed- benchmarks/benchmarks
- numpy/_core
- src
- multiarray
- umath
- tests
5 files changed
+105
-192
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
591 | 597 | | |
592 | 598 | | |
593 | 599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 331 | + | |
| 332 | + | |
340 | 333 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
349 | 340 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | 341 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
| 342 | + | |
| 343 | + | |
375 | 344 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
| 345 | + | |
| 346 | + | |
388 | 347 | | |
389 | | - | |
390 | | - | |
| 348 | + | |
| 349 | + | |
391 | 350 | | |
392 | 351 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
401 | 356 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
| 357 | + | |
| 358 | + | |
407 | 359 | | |
408 | | - | |
409 | | - | |
410 | 360 | | |
411 | | - | |
412 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
413 | 364 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
450 | 369 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
| 370 | + | |
| 371 | + | |
487 | 372 | | |
488 | | - | |
489 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
490 | 378 | | |
491 | 379 | | |
492 | 380 | | |
| |||
643 | 531 | | |
644 | 532 | | |
645 | 533 | | |
646 | | - | |
| 534 | + | |
| 535 | + | |
647 | 536 | | |
648 | 537 | | |
649 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
489 | 508 | | |
490 | 509 | | |
491 | 510 | | |
492 | 511 | | |
493 | 512 | | |
494 | 513 | | |
495 | 514 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
503 | 523 | | |
504 | 524 | | |
505 | 525 | | |
506 | 526 | | |
| 527 | + | |
| 528 | + | |
507 | 529 | | |
508 | 530 | | |
509 | | - | |
510 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
511 | 537 | | |
512 | 538 | | |
513 | 539 | | |
| |||
518 | 544 | | |
519 | 545 | | |
520 | 546 | | |
521 | | - | |
| 547 | + | |
522 | 548 | | |
523 | 549 | | |
524 | 550 | | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | 551 | | |
534 | | - | |
535 | | - | |
536 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
537 | 557 | | |
538 | 558 | | |
539 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
244 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
245 | 258 | | |
246 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
247 | 266 | | |
248 | 267 | | |
249 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4125 | 4125 | | |
4126 | 4126 | | |
4127 | 4127 | | |
4128 | | - | |
4129 | | - | |
4130 | | - | |
4131 | | - | |
4132 | | - | |
4133 | | - | |
4134 | | - | |
4135 | | - | |
4136 | | - | |
4137 | | - | |
4138 | | - | |
4139 | | - | |
4140 | | - | |
4141 | | - | |
4142 | | - | |
4143 | | - | |
4144 | | - | |
4145 | | - | |
4146 | | - | |
4147 | | - | |
4148 | | - | |
4149 | 4128 | | |
4150 | 4129 | | |
4151 | 4130 | | |
| |||
0 commit comments