Last active
April 20, 2021 19:10
-
-
Save gravitino/bc82139f44df42288bee4fb460775916 to your computer and use it in GitHub Desktop.
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
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"elapsed time: 8 ms (align sdist fft)\n", | |
"elapsed time: 43 ms (align sdist naive)\n", | |
"elapsed time: 8 ms (align sdist fft)\n", | |
"elapsed time: 43 ms (align sdist naive)\n", | |
"elapsed time: 8 ms (align sdist fft)\n", | |
"elapsed time: 43 ms (align sdist naive)\n", | |
"elapsed time: 8 ms (align sdist fft)\n", | |
"elapsed time: 44 ms (align sdist naive)\n", | |
"elapsed time: 8 ms (align sdist fft)\n", | |
"elapsed time: 43 ms (align sdist naive)\n" | |
] | |
} | |
], | |
"source": [ | |
"query_gpu, subject_gpu = cp.asarray(query), cp.asarray(subject)\n", | |
"\n", | |
"for _ in range(num_repeats):\n", | |
" with ra.util.Timer(\"align sdist fft\"):\n", | |
" ying = ra.ED.sdist(query_gpu, subject_gpu, mode=\"fft\")\n", | |
" with ra.util.Timer(\"align sdist naive\"):\n", | |
" yang = ra.ED.sdist(query_gpu, subject_gpu, mode=\"naive\")\n", | |
" \n", | |
"assert(cp.allclose(ying, yang))" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.8" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment