Esempio n. 1
0
 def test_cublasCsscal(self):
     x = (np.random.rand(5)+1j*np.random.rand(5)).astype(np.complex64)
     x_gpu = gpuarray.to_gpu(x)
     alpha = np.float32(np.random.rand())
     cublas.cublasCscal(x_gpu.size, alpha,
                        x_gpu.gpudata, 1)
     assert np.allclose(x_gpu.get(), alpha*x)
Esempio n. 2
0
 def test_cublasCsscal(self):
     x = (np.random.rand(5) + 1j * np.random.rand(5)).astype(np.complex64)
     x_gpu = gpuarray.to_gpu(x)
     alpha = np.float32(np.random.rand())
     cublas.cublasCscal(self.cublas_handle, x_gpu.size, alpha,
                        x_gpu.gpudata, 1)
     assert np.allclose(x_gpu.get(), alpha * x)