Exemple #1
0
    def testToGPUExecution(self):
        raw = np.random.rand(10, 10)
        x = tensor(raw, chunk_size=3)

        gx = to_gpu(x)

        res = self.executor.execute_tensor(gx, concat=True)[0]
        np.testing.assert_array_equal(res.get(), raw)
Exemple #2
0
def test_to_gpu():
    x = tensor(np.random.rand(10, 10), chunk_size=3)

    gx = to_gpu(x)

    assert gx.dtype == x.dtype
    assert gx.order == x.order
    assert gx.op.gpu is True

    gx, x = tile(gx, x)

    assert gx.chunks[0].dtype == x.chunks[0].dtype
    assert gx.chunks[0].order == x.chunks[0].order
    assert gx.chunks[0].op.gpu is True
Exemple #3
0
    def testToGPU(self):
        x = tensor(np.random.rand(10, 10), chunk_size=3)

        gx = to_gpu(x)

        self.assertEqual(gx.dtype, x.dtype)
        self.assertEqual(gx.order, x.order)
        self.assertTrue(gx.op.gpu)

        gx.tiles()

        self.assertEqual(gx.chunks[0].dtype, x.chunks[0].dtype)
        self.assertEqual(gx.chunks[0].order, x.chunks[0].order)
        self.assertTrue(gx.chunks[0].op.gpu)