That did work - thank you, see code below. To explain: this came from a
bottleneck in a bigger code, so my problem there must be a different one.
-- Christoph
function testtime()
a1 = rand(10, 10, 100, 100)
b1 = rand(10, 100, 100)
c1 = rand(10, 100, 100)
d1 = []
const a2 = rand(10,10,100,100)
const b2 = rand(10,100,100)
const c2 = rand(10,100,100)
d2 = []
@time(begin
for n = 1:10
d1 = [ a1[a,b,i,j] .* b1[a,i,j] .* c1[b,i,j] for a = 1:10, b =
1:10, i=1:100,j=1:100 ]
end
end)
println(typeof(d1))
@time(begin
for n = 1:10
d2 = [ a2[a,b,i,j] .* b2[a,i,j] .* c2[b,i,j] for a = 1:10, b =
1:10, i=1:100,j=1:100 ]
end
end)
println(typeof(d2))
end
testtime()