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)
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)