Skip to content

Commit

Permalink
Merge pull request #10 from kmaehashi/add-array-bench
Browse files Browse the repository at this point in the history
add core benchmark
  • Loading branch information
asi1024 committed Jun 22, 2018
2 parents 69e4bff + e166250 commit 6ad6164
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions benchmarks/cupy/bench_core.py
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)

0 comments on commit 6ad6164

Please sign in to comment.