Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

‘_mm_loadu_epi8’ was not declared in this scope [duplicate]

$
0
0

My code is calulating L2 distance between vectors.

  __m512 sum = _mm512_setzero_ps();  __m512 dot5 = _mm512_set1_ps(0.5f);  __m512 const_255 = _mm512_set1_ps(255.0f);  for (int i = 0; i < d; i += 16) {    auto zz = _mm_loadu_epi8(y + i);    auto zzz = _mm512_cvtepu8_epi32(zz);    auto yy = _mm512_cvtepi32_ps(zzz);    yy = _mm512_add_ps(yy, dot5);    auto mi512 = _mm512_loadu_ps(mi + i);    auto dif512 = _mm512_loadu_ps(dif + i);    yy = _mm512_mul_ps(yy, dif512);    yy = _mm512_add_ps(yy, _mm512_mul_ps(mi512, const_255));    auto xx = _mm512_loadu_ps(x + i);    auto d = _mm512_sub_ps(_mm512_mul_ps(xx, const_255), yy);    sum = _mm512_fmadd_ps(d, d, sum);  }

GCC 9.0 throws an error.

error: ‘_mm_loadu_epi8’ was not declared in this scope; did you mean ‘_mm_add_epi8’?  277 |     auto zz = _mm_loadu_epi8(y + i);

Here is my CPU info. It supports AVX512 instructions, but still can't find '_mm_loadu_epi8'.

Architecture:        x86_64CPU op-mode(s):      32-bit, 64-bitByte Order:          Little EndianCPU(s):              72On-line CPU(s) list: 0-71Thread(s) per core:  2Core(s) per socket:  18Socket(s):           2NUMA node(s):        2Vendor ID:           GenuineIntelCPU family:          6Model:               85Model name:          Intel(R) Xeon(R) Gold 6240C CPU @ 2.60GHzStepping:            5CPU MHz:             3582.027BogoMIPS:            5200.00Virtualization:      VT-xL1d cache:           32KL1i cache:           32KL2 cache:            1024KL3 cache:            25344KFlags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear flush_l1d arch_capabilities

My environment is Ubuntu18.04, and I tried gcc7.5 and gcc9, both versions have the same mistake.


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>