Open xzackli opened 5 years ago
When I run the CuArrays example in the documentation for cg on Julia 1.1/1.2, I get a warning about scalar operations.
using LinearAlgebra, CuArrays, IterativeSolvers n = 100 A = cu(rand(n, n)) A = A + A' + 2*n*I b = cu(rand(n)) x = cg(A, b)
┌ Warning: Performing scalar operations on GPU arrays: This is very slow, consider disallowing these operations with `allowscalar(false)`
This fails on the uniformscaling. Messing around a bit with CuArrays.allowscalar(false), I find that replacing it with
CuArrays.allowscalar(false)
A = A + A' + cu(Diagonal(fill(2 * n * 1.0f0,n)))
seems to work. Maybe just update the documentation?
When I run the CuArrays example in the documentation for cg on Julia 1.1/1.2, I get a warning about scalar operations.
This fails on the uniformscaling. Messing around a bit with
CuArrays.allowscalar(false)
, I find that replacing it withseems to work. Maybe just update the documentation?