Created
December 19, 2019 06:18
-
-
Save asi1024/e8e2b77533fbe2451205f3de70b2fdba 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
import itertools | |
import numpy | |
import cupy | |
import cupyx | |
shapes = [(4096, 4096), (64, 64, 64, 64)] | |
for shape in shapes: | |
ndim = len(shape) | |
size = numpy.prod(shape) | |
range_ndim = list(range(ndim)) | |
for perm in itertools.permutations(range_ndim, ndim): | |
for n_axis in range(1, ndim + 1): | |
for axes in itertools.combinations(range_ndim, n_axis): | |
x = cupy.arange(size, dtype='f').reshape(shape) | |
x = x.transpose(perm) | |
perf = cupyx.time.repeat(cupy.sum, (x, axes), n=100) | |
print(perf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment