def test_cic_mmul_baseline(self, shape, shift, density, benchmark): cic, matrix = self.get_setup(shape, shift, density) csr = cic.tocsr() benchmark(csr._mul_multivector, matrix) benchmark.extra_info['memory'] = nbytes(csr)
def test_cic_mmul(self, shape, shift, density, benchmark): cic, matrix = self.get_setup(shape, shift, density) result = benchmark(cic._mul_multivector, matrix) assert np.allclose(result, cic.tocsr()._mul_multivector(matrix)) benchmark.extra_info['memory'] = nbytes(cic)
def test_vsb_cir_mmul_baseline(self, n_blocks, block_shape, block_shift, shift, density, benchmark): vsb, matrix = self.get_setup(n_blocks, block_shape, block_shift, shift, density) csr = vsb.tocsr() benchmark(csr._mul_multivector, matrix) benchmark.extra_info['memory'] = nbytes(csr)
def test_cvb_cir_vmul_baseline(self, n_blocks, block_shape, block_shift, shift, density, benchmark): cvb, vector = self.get_setup(n_blocks, block_shape, block_shift, shift, density) csr = cvb.tocsr() benchmark(csr._mul_vector, vector) benchmark.extra_info['memory'] = nbytes(csr)
def test_vsb_cir_mmul(self, n_blocks, block_shape, block_shift, shift, density, benchmark): vsb, matrix = self.get_setup(n_blocks, block_shape, block_shift, shift, density) result = benchmark(vsb._mul_multivector, matrix) assert np.allclose(result, vsb.tocsr()._mul_multivector(matrix)) benchmark.extra_info['memory'] = nbytes(vsb)
def test_cvb_cir_vmul(self, n_blocks, block_shape, block_shift, shift, density, benchmark): cvb, vector = self.get_setup(n_blocks, block_shape, block_shift, shift, density) result = benchmark(cvb._mul_vector, vector) assert np.allclose(result, cvb.tocsr()._mul_vector(vector)) benchmark.extra_info['memory'] = nbytes(cvb)