Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7646 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
393 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-...

 

 

0 Kudos
1 Solution
jimdempseyatthecove
Black Belt
377 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
Black Belt
378 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
374 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

jimdempseyatthecove
Black Belt
357 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
346 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 ...   

 

 

 

VidyalathaB_Intel
Moderator
318 Views

Hi Mike,

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

Regards,

Vidya


mikeitexpert
New Contributor II
299 Views

Yes it is answered!

Feel free to close the thread.

thanks so much !

VidyalathaB_Intel
Moderator
286 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


Reply