Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simple SIMD examples for training purposes

License

NotificationsYou must be signed in to change notification settings

VectorCamp/simd-examples

Repository files navigation

Simple SIMD examples for training purposes

TODO

Add makefile

Examples

average_sse.c

Calculates the average ofN values in scalar and using SSE on x86

$ gcc -O3 average_sse.c -o average_sse
$ ./average_sseupdated diff1 tv_sec:2 tv_usec:151147updated diff2 tv_sec:1 tv_usec:337442average of 1073741824 elements = 16777216.000000 (scalar), 16777216.000000 (SSE)scalar: 2 sec, usec: 151147SSE: 1 sec, usec: 337442

average_avx2.c

Calculates the average ofN values in scalar and using AVX2 on x86

$ gcc -mavx2 -O3 average_avx2.c -o average_avx2
$ ./average_avx2 updated diff1 tv_sec:2 tv_usec:549127average of 1073741824 elements = 16777216.000000 (scalar), 16777216.000000 (AVX2)scalar: 2 sec, usec: 549127avx2   : 1 sec, usec: 337110

average_avx512.c

Calculates the average ofN values in scalar and using AVX512 on x86

$ gcc -mavx512f -O3 average_avx512.c -o average_avx512
$ ./average_avx512updated diff1 tv_sec:2 tv_usec:550474average of 1073741824 elements = 16777216.000000 (scalar), 16777216.000000 (AVX512)scalar: 2 sec, usec: 550474avx512   : 1 sec, usec: 336621

About

Simple SIMD examples for training purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp