Created
February 9, 2021 19:01
-
-
Save wphicks/774701358b3aa4be33277aa4cc7cd7d2 to your computer and use it in GitHub Desktop.
Quick benchmark for cupy.percentile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cupy | |
from cupyx.time import repeat | |
cupy.random.seed(0) | |
for size in (5, 50, 500, 5000, 50000, int(5e6)): | |
a = cupy.random.rand(size) | |
q = cupy.linspace(0, 100, 3) | |
def f(): | |
cupy.percentile(a, q, interpolation='linear') | |
print(f"For array of length {size}") | |
print(repeat(f)) | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment