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

_mm256_load_si256

SGold21
Beginner
1,445 Views

Hi

Suddenly, using this program gives strange results - only the lower 128 bits are loaded and the upper are zeroized.

What can be wrong?

I use Visual Studio 2015 with the 2017 compiler.

Thank you!

 

Sorin

0 Kudos
7 Replies
Viet_H_Intel
Moderator
1,445 Views

Can you provide a test case for us to investigate?

0 Kudos
SGold21
Beginner
1,445 Views

Not really.

I have created a new simple project - there it works OK.

But this project - it simply doesn't - no matter where I stuck the code. 

 

for example

 

NoiseGen.rand_byte(DataB, KBytes); // This populates Data with random values
__m256i a = _mm256_load_si256((__m256i*) DataB); 

only the lower 16 bytes are loaded with data. 

In addition - doing the following

 

    __m256i CQv = _mm256_loadu_si256((__m256i *) Qv + CurrentQAddress[0]); // upper 16 bytes are 0
                __m128i aa = _mm_load_si128((__m128i *) (Qv + 8)); // load 16 bytes
                CQv = _mm256_inserti128_si256(CQv, aa, 1);// insert into the upper 16 bytes

And the 16 upper are still zero.

 

BTW, I've opened a new project (starting with new settings) and moved the old code into. It doesn't change the results.

What can be wrong?

 

 

 

 

 

0 Kudos
SGold21
Beginner
1,445 Views

These lines will load 32 bytes to mSumx


 

 

These lines

__m128i mSumb = _mm_load_si128((__m128i*) (Sum + 32));

    __m256i mSumx = _mm256_load_si256((__m256i*) Sum);

won't

 

0 Kudos
SGold21
Beginner
1,445 Views

OK

I think the problem is with Visual Studio 2015. 
I've downloaded Visual Studio 2019

I've installed Intel parallel 2019 update 4 which supports 2019 (so I understand).

But when I try to compile I get:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 19.0\Toolset.targets(350,5): error : Element <LanguageStandard> has an invalid value of "Default".
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Platforms\x64\PlatformToolsets\Intel C++ Compiler 19.0\Toolset.targets(350,5): error MSB6011: Invalid parameters passed to the Intel.Build.ICLTasks.ICL task.
 

What can I do. I am stuck.

Thanks

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,445 Views

What does examining the disassembly with op codes show as the instruction byte sequence?

As a work around, you may be able to cast as a different variable type (#define _mm256_load_si256 ...)

Jim Dempsey

0 Kudos
SGold21
Beginner
1,445 Views

jimdempseyatthecove (Blackbelt) wrote:

What does examining the disassembly with op codes show as the instruction byte sequence?

As a work around, you may be able to cast as a different variable type (#define _mm256_load_si256 ...)

Jim Dempsey

 

Seems that Visual Studio is the problem. 
I have an old code. When running - it's perfect. When debugging - it shows the error.
When debugging the code in Visual Studio 2019, the debugging shows everything is OK.
But, I have a problem debugging.

0 Kudos
SGold21
Beginner
1,445 Views

Visual Studio 2017 works

0 Kudos
Reply