CLyther for NumPy UsersΒΆ

simple numpy script:

import numpy as np

a = np.arange(12, dtype='f')
b = np.arange(12, dtype='f').reshape([12,1])

c = a + b

assert c.shape == (12, 12)

assert np.sum(c).item() == 1584.0

simple clyther script:

from clyther.array import CLArrayContext

np = CLArrayContext()

a = np.arange(12, dtype='f')
b = np.arange(12, dtype='f').reshape([12,1])

c = a + b

assert c.shape == (12, 12)

assert np.sum(c).item() == 1584.0

Previous topic

Performance Python

Next topic

API

This Page