-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from kmaehashi/add-array-bench
add core benchmark
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from benchmarks import BenchmarkBase | ||
from benchmarks.utils import sync | ||
from benchmarks.utils import parameterize | ||
|
||
import cupy | ||
import numpy | ||
|
||
|
||
@sync | ||
@parameterize([ | ||
('dtype', ['float32', 'complex128']), | ||
('ndim', [0, 1, 2, 5, 8]), | ||
('in_order', ['C', 'F']), | ||
('out_order', ['C', 'F']), | ||
]) | ||
class Array(BenchmarkBase): | ||
def setup(self, dtype, ndim, in_order, out_order): | ||
self.x = numpy.zeros((10,) * ndim, dtype=dtype, order=in_order) | ||
|
||
def time_array_from_numpy(self, dtype, ndim, in_order, out_order): | ||
cupy.array(self.x, order=out_order) |