Vectorization issue Intel compiler
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 507
- Forks
- 87
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 2
Description
Hello, I'm having problem vectorizing this very simple loop where dolic_c and tke_Lmix are mdspan objects:
for (int jc = start_index; jc <= end_index; jc++)
tke_Lmix(blockNo, dolic_c(blockNo, jc), jc) = 0.0;
I'm using intel compiler and from the report I get the following output:
remark #15389: vectorization support: reference dolic_c.__members.__members[blockNo*dolic_c.__members.__members.__members.__members.__members.__members.__members[1]+jc] has unaligned access [ /home/k/k202136/YAOP/src/backends/CPU/cpu_kernels.hpp(68,38) ]
remark #15381: vectorization support: unaligned access used inside loop body
remark #15335: loop was not vectorized: vectorization possible but seems inefficient. Use vector always directive or -vec-threshold0 to override
remark #15329: vectorization support: irregularly indexed store was emulated for the variable <tke_Lmix.__members.__members[(blockNo*tke_Lmix.__members.__membe>, part of index is read from memory [ /home/k/k202136/YAOP/src/backends/CPU/cpu_kernels.hpp(68,21) ]
remark #15305: vectorization support: vector length 4
remark #15309: vectorization support: normalized vectorization overhead 0.049
remark #15450: unmasked unaligned unit stride loads: 1
remark #15463: unmasked indexed (or scatter) stores: 1
remark #15475: --- begin vector cost summary ---
remark #15476: scalar cost: 11
remark #15477: vector cost: 25.750
remark #15478: estimated potential speedup: 0.420
remark #15488: --- end vector cost summary ---
remark #25439: unrolled with remainder by 2
I think that this is simple enough that should be handled by the compiler and I also don't understand the "irregularly indexed store" issue mentioned in the report
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the loop reported at cpu_kernels.hpp line 68 and reproduce the Intel compiler vectorization report for the mdspan objects dolic_c and tke_Lmix. Trace their indexing and layout to determine why the store is treated as irregular and whether the behavior comes from mdspan or the compiler; document the finding and any actionable workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100