Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'compile_test/avx512vnni.cc')
-rw-r--r--compile_test/avx512vnni.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/compile_test/avx512vnni.cc b/compile_test/avx512vnni.cc
new file mode 100644
index 0000000..1485cde
--- /dev/null
+++ b/compile_test/avx512vnni.cc
@@ -0,0 +1,24 @@
+#include <immintrin.h>
+
+#if defined(_MSC_VER)
+#elif defined(__INTEL_COMPILER)
+__attribute__ ((target ("avx512f")))
+#else
+__attribute__ ((target ("avx512f,avx512bw,avx512dq,avx512vnni")))
+#endif
+bool Foo() {
+ // AVX512F
+ __m512i value = _mm512_set1_epi32(1);
+ // AVX512BW
+ value = _mm512_maddubs_epi16(value, value);
+ // AVX512DQ
+ __m256i value2 = _mm256_set1_epi8(1);
+ value = _mm512_inserti32x8(value, value2, 1);
+ // AVX512VNNI
+ value = _mm512_dpbusd_epi32(value, value, value);
+ return *(int*)&value;
+}
+
+int main() {
+ return Foo();
+}