# Problem with LoopVectorization : @turbo, LoopVectorization.check\_args

**URL:** <https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963>\
**Category:** Performance\
**Tags:** loopvectorization\
**Created:** [March 16, 2022, 12:15pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963 "2022-03-16T12:15:20Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 20, 2022, 12:11am UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/21 "2022-10-20T00:11:41Z")

</div>

Can you try `] registry up`?

---

<div class="post-metadata">

**Author:** ![dforero0896](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dforero0896](https://discourse.julialang.org/u/dforero0896)\
**Post date:** [October 20, 2022, 7:32am UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/22 "2022-10-20T07:32:52Z")

</div>

Nothing happened with `] registry up`.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 20, 2022, 1:47pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/23 "2022-10-20T13:47:53Z")

</div>

Maybe?

```julia
pkg> registry rm General
pkg> registry add https://github.com/JuliaRegistries/General
pkg> up
pkg> add VectorizationBase@0.21.54

```

---

<div class="post-metadata">

**Author:** ![swish47](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swish47/32/43921_2.png) [@swish47](https://discourse.julialang.org/u/swish47)\
**Post date:** [October 21, 2022, 8:22pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/24 "2022-10-21T20:22:49Z")

</div>

Hi, do you solve your problem? I tried to use StructArray.jl but it still didn’t work:

```julia
val=StructArray(0.0+0.0*im);st=rand(1000000);
@turbo for n in 1:2
    val +=StructArray(inv(1.0+0.0001*im - st[n]))
end
┌ Warning: #= In[121]:1 =#:
│ `LoopVectorization.check_args` on your inputs failed; running fallback `@inbounds @fastmath` loop instead.
│ Use `warn_check_args=false`, e.g. `@turbo warn_check_args=false ...`, to disable this warning.
└ @ Main C:\Users\mymoo\.julia\packages\LoopVectorization\FMfT8\src\condense_loopset.jl:1049
ArgumentError: only eltypes with fields are supported

```

What’s wrong with this and how to make this correct?

---

<div class="post-metadata">

**Author:** ![swish47](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swish47/32/43921_2.png) [@swish47](https://discourse.julialang.org/u/swish47)\
**Post date:** [October 22, 2022, 11:21pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/25 "2022-10-22T23:21:13Z")

</div>

Update:  
I just add a transit variable in loop, and now it works.

```julia
val=StructArray(0.0+0.0*im);st=rand(1000000);
@turbo for n in 1:2
        v=val;
        val =v+StructArray(inv(1.0+im*0.001 - st[n]))
        end
0.001791 seconds (6.94 k allocations: 387.273 KiB, 95.28% compilation time)

```

I can’t understand why is it correct now.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 23, 2022, 12:00am UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/26 "2022-10-23T00:00:02Z")

</div>

LoopVectorization.jl will only warn once, so you’re probably just not seeing the warning.

---

<div class="post-metadata">

**Author:** ![swish47](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swish47/32/43921_2.png) [@swish47](https://discourse.julialang.org/u/swish47)\
**Post date:** [October 23, 2022, 12:47pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/27 "2022-10-23T12:47:21Z")

</div>

I compare the time consuming of cases with or without `@turbo`, and they are different. `@turbo` case is 10x faster. I guess it works well. Just I cannot understand it’s mechanism on this example, and all variables matches types each other. Could I know how to make this correct?

---

<div class="post-metadata">

**Author:** ![dforero0896](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dforero0896](https://discourse.julialang.org/u/dforero0896)\
**Post date:** [October 26, 2022, 2:46pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963/28 "2022-10-26T14:46:50Z")

</div>

It work updating as you suggested. Though it basically made a new General registry in my local directory (I’m working on a cluster so I don’t have permissions for the `rm` line). Thanks for your help!

[Previous page](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963.md?page=1)
