Julia stupid memory allocation bug workaround

Fri, 27 Aug 2021 16:35:50 +0300

author
Tuomo Valkonen <tuomov@iki.fi>
date
Fri, 27 Aug 2021 16:35:50 +0300
changeset 28
ffd693c381f2
parent 27
62c62f451a41
child 29
69242e8598eb

Julia stupid memory allocation bug workaround

src/Util.jl file | annotate | diff | comparison | revisions
--- a/src/Util.jl	Tue Apr 13 15:51:51 2021 -0500
+++ b/src/Util.jl	Fri Aug 27 16:35:50 2021 +0300
@@ -195,7 +195,7 @@
         @inbounds @simd for i=1:size(y′, 2)# in CartesianIndices(size(y)[2:end])
             n² = norm₂²(@view(y′[:, i]))
             if n²>α²
-                y′[:, i] .*= (α/√n²)
+                @. @views y′[:, i] = y′[:, i]*(α/√n²)
             end
         end
     end

mercurial