Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

what does it mean? : A scalar L-value may not be assigned under a vector condition. It is an error.

mikeitexpert
New Contributor II
826 Views

Hello Everybody,

I started vector programming just recently using ICL and I am really enjoying Intel facilities in this regard. 

I just come across a stetement as highlighted below, however I have a hard time making sense of it. In particular I don't understand what is meant by "vector condition".

I would appreciate if sb please elaborate as I am new to vector programming.

Regards

mikeitexpert_0-1617356276281.png

 

 

https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/optimization-and-programming-guide/vectorization/explicit-vector-programming/user-mandated-or-simd-vectorization.html

 

 

0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
810 Views

scalar means non-vector (single) variable
L-value means left of =

vector condition... means a vector of conditions (not necessarily all having the same values)

result = yes, no, no, yes // make up your mind, what does this mean???

Jim Dempsey

View solution in original post

7 Replies
jimdempseyatthecove
Honored Contributor III
811 Views

scalar means non-vector (single) variable
L-value means left of =

vector condition... means a vector of conditions (not necessarily all having the same values)

result = yes, no, no, yes // make up your mind, what does this mean???

Jim Dempsey

mikeitexpert
New Contributor II
807 Views

So, If I understand your point correctly, it simply means that given a vector of boolean condition vector (eg. vectorized version of an if condition (deciding which R-value to be assigned to a scaler L-value) ), we logically can't decide which value to assign to a single scaler L-value and thus should be avoided. 

Is that correct ????

Regards

0 Kudos
jimdempseyatthecove
Honored Contributor III
790 Views

Yes, however, keep in mind that there are instructions that can return a scalar result from a function performed on a vector. For example

    float _mm512_reduce_gmax_ps (__m512 a)

Jim Dempsey

mikeitexpert
New Contributor II
779 Views

Yes I totally understand that ... I have done some vector programming before and I graps your points. It is just sometimes I don't know the compiler-related terms very well and it makes me ask stupid questions just to confirm my understanding.  

I keep Intel Intrinsics Guide under my plow and check the execution cycles for different interinsics every now and then.  

I just converted a pretty large Matlab code to C++  and it is a hassle to vertorize manually so I am trying to learn nots and bolts of Intel's Auto Vectorization before I make any stupid mistakes ...   

 

 

 

0 Kudos
VidyalathaB_Intel
Moderator
751 Views

Hi Mike,

Could you please confirm if your issue is resolved and whether we can close this thread.

Regards,

Vidya


0 Kudos
mikeitexpert
New Contributor II
732 Views

Yes it is answered!

Feel free to close the thread.

thanks so much !

0 Kudos
VidyalathaB_Intel
Moderator
719 Views

Hi Mike,

Thanks for the confirmation!

As this issue has been resolved, we will no longer respond to this thread.

If you require any additional assistance from Intel, please start a new thread.

Any further interaction in this thread will be considered community only.

Have a Good day.


Thanks & Regards

Vidya


0 Kudos
Reply