Sunday, March 20, 2022

Sunday, February 20, 2022

Intel SIMD tutorials

By Intel

1. Intel® Intrinsics Guide

https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html

2. Mirror of Intel® Intrinsics Guide

https://www.laruence.com/sse/

3. Guide to vectorization with Intel C++ compilers

 https://www.intel.com/content/dam/www/public/us/en/documents/guides/compiler-auto-vectorization-guide.pdf



By others

1. Faster Set Intersection with SIMD instructions by Reducing ...

http://www.vldb.org/pvldb/vol8/p293-inoue.pdf

2. CS3330: A quick guide to SSE/SIMD

https://www.cs.virginia.edu/~cr4bd/3330/F2018/simdref.html

3. Improving performance with SIMD intrinsics in three use cases

https://stackoverflow.blog/2020/07/08/improving-performance-with-simd-intrinsics-in-three-use-cases/

* 4. Matrix Multiplication Revisited | Richard Startin's Blog

https://richardstartin.github.io/posts/mmm-revisited

5. A Fast Matrix-Matrix Multiply Using Intel's SSE Instructions

https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.23.6754&rep=rep1&type=pdf

6. https://shura.shu.ac.uk/18355/1/Kelefouras-Matrix-MatrixMultiplicationMethodologyforSIngleMulti-Core%28AM%29.pdf

7. https://www.uio.no/studier/emner/matnat/ifi/IN3200/v19/teaching-material/avx512.pdf

8. https://compilers.cs.uni-saarland.de/papers/leissa_vecimp_tr.pdf




Saturday, January 8, 2022

How to convert float to int or short

http://stereopsis.com/FPU.html
https://stackoverflow.com/questions/78619/what-is-the-fastest-way-to-convert-float-to-int-on-x86


SIMD
32 bit integer to 16 bit integer
__m256i _mm512_cvtepi32_epi16 (__m512i a)

floating point to 32 bit integer
__m512i _mm512_cvtps_epi32 (__m512 a)


unsigned short _cvtss_sh (float aint rounding)




Get current CPU core frequency - linux

1. Get the current application's permission

"getuid()"

"geteuid()"


2. turbostat: https://github.com/torvalds/linux/blob/master/tools/power/x86/turbostat/turbostat.c