Add support for AVX2 and runtime feature detection (#174)
- [x] run unit tests - [x] run all samples
This commit is contained in:
parent
51f056e0a9
commit
e77352cd60
53 changed files with 4681 additions and 3376 deletions
9
benchmark/amd7950x_avx2/convex_pile.csv
Normal file
9
benchmark/amd7950x_avx2/convex_pile.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,5092.19
|
||||
2,2694.4
|
||||
3,1855.5
|
||||
4,1450.33
|
||||
5,1195.15
|
||||
6,1032.87
|
||||
7,924.237
|
||||
8,843.199
|
||||
|
9
benchmark/amd7950x_avx2/joint_grid.csv
Normal file
9
benchmark/amd7950x_avx2/joint_grid.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,1308.56
|
||||
2,683.543
|
||||
3,461.149
|
||||
4,351.313
|
||||
5,283.848
|
||||
6,239.34
|
||||
7,208.293
|
||||
8,185.43
|
||||
|
9
benchmark/amd7950x_avx2/junkyard.csv
Normal file
9
benchmark/amd7950x_avx2/junkyard.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,11252.9
|
||||
2,5915.73
|
||||
3,4113.86
|
||||
4,3194.52
|
||||
5,2626.44
|
||||
6,2261.77
|
||||
7,2009.22
|
||||
8,1824.68
|
||||
|
9
benchmark/amd7950x_avx2/large_pyramid.csv
Normal file
9
benchmark/amd7950x_avx2/large_pyramid.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,1067.06
|
||||
2,558.46
|
||||
3,390.698
|
||||
4,300.188
|
||||
5,249.834
|
||||
6,218.912
|
||||
7,193.65
|
||||
8,175.819
|
||||
|
9
benchmark/amd7950x_avx2/large_world.csv
Normal file
9
benchmark/amd7950x_avx2/large_world.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,5.0616
|
||||
2,6.9262
|
||||
3,7.827
|
||||
4,8.2244
|
||||
5,8.7631
|
||||
6,8.6223
|
||||
7,8.7636
|
||||
8,8.9294
|
||||
|
9
benchmark/amd7950x_avx2/many_pyramids.csv
Normal file
9
benchmark/amd7950x_avx2/many_pyramids.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,1163.37
|
||||
2,605.215
|
||||
3,411.543
|
||||
4,307.527
|
||||
5,249.396
|
||||
6,216.535
|
||||
7,184.334
|
||||
8,165.442
|
||||
|
9
benchmark/amd7950x_avx2/rain.csv
Normal file
9
benchmark/amd7950x_avx2/rain.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,2038.39
|
||||
2,1110.3
|
||||
3,773.18
|
||||
4,603.397
|
||||
5,502.292
|
||||
6,434.461
|
||||
7,389.414
|
||||
8,355.206
|
||||
|
9
benchmark/amd7950x_avx2/sleep.csv
Normal file
9
benchmark/amd7950x_avx2/sleep.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,596.258
|
||||
2,328.927
|
||||
3,231.57
|
||||
4,187.904
|
||||
5,159.347
|
||||
6,142.58
|
||||
7,131.034
|
||||
8,124.711
|
||||
|
9
benchmark/amd7950x_avx2/spinner.csv
Normal file
9
benchmark/amd7950x_avx2/spinner.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,2919.32
|
||||
2,1674.26
|
||||
3,1200.43
|
||||
4,960.786
|
||||
5,821.659
|
||||
6,728.967
|
||||
7,669.058
|
||||
8,626.733
|
||||
|
9
benchmark/amd7950x_avx2/trees100.csv
Normal file
9
benchmark/amd7950x_avx2/trees100.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,167.468
|
||||
2,110.54
|
||||
3,87.5729
|
||||
4,77.6966
|
||||
5,73.9776
|
||||
6,71.7265
|
||||
7,69.6889
|
||||
8,69.3954
|
||||
|
9
benchmark/amd7950x_avx2/trees25.csv
Normal file
9
benchmark/amd7950x_avx2/trees25.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,657.535
|
||||
2,386.678
|
||||
3,284.076
|
||||
4,245.238
|
||||
5,223.137
|
||||
6,208.401
|
||||
7,197.529
|
||||
8,194.169
|
||||
|
9
benchmark/amd7950x_avx2/trees50.csv
Normal file
9
benchmark/amd7950x_avx2/trees50.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,285.043
|
||||
2,176.584
|
||||
3,135.305
|
||||
4,117.663
|
||||
5,109.496
|
||||
6,104.289
|
||||
7,101.186
|
||||
8,98.9602
|
||||
|
9
benchmark/amd7950x_avx2/washer.csv
Normal file
9
benchmark/amd7950x_avx2/washer.csv
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
threads,ms
|
||||
1,15669.7
|
||||
2,8410.7
|
||||
3,5793.28
|
||||
4,4493.58
|
||||
5,3722.97
|
||||
6,3219.45
|
||||
7,2849.15
|
||||
8,2562.49
|
||||
|
|
|
@ -125,7 +125,7 @@ static void RunSatBenchmarks( int runCount )
|
|||
int repeatCount = 1;
|
||||
#endif
|
||||
|
||||
printf( "benchmark: sat, pairs = %d, repeats = %d\n", SAT_PAIR_COUNT, repeatCount );
|
||||
printf( "benchmark: sat, pairs = %d, repeats = %d, simd width = %d\n", SAT_PAIR_COUNT, repeatCount, GetSimdWidth() );
|
||||
printf( "time per query (us), sat full has the inscribed sphere bound disabled\n" );
|
||||
printf( "%-20s %10s %10s %10s %10s\n", "pair", "gjk cold", "gjk warm", "sat", "sat full" );
|
||||
|
||||
|
|
@ -284,6 +284,7 @@ int main( int argc, char** argv )
|
|||
bool enableContinuous = true;
|
||||
bool recordStepTimes = false;
|
||||
bool runSat = false;
|
||||
int simdWidth = 0;
|
||||
|
||||
assert( maxThreadCount <= B3_MAX_WORKERS );
|
||||
|
||||
|
|
@ -338,6 +339,20 @@ int main( int argc, char** argv )
|
|||
#else
|
||||
printf( "The SAT benchmark requires static linkage\n" );
|
||||
exit( 1 );
|
||||
#endif
|
||||
}
|
||||
else if ( ( value = MatchValue( arg, "-simd=", "--simd-width=" ) ) != NULL )
|
||||
{
|
||||
simdWidth = atoi( value );
|
||||
if ( simdWidth != 4 && simdWidth != 8 )
|
||||
{
|
||||
printf( "The SIMD width must be 4 or 8\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
#ifndef BOX3D_INTERNAL_BENCHMARKS
|
||||
printf( "Forcing the SIMD width requires static linkage\n" );
|
||||
exit( 1 );
|
||||
#endif
|
||||
}
|
||||
else if ( strcmp( arg, "-l" ) == 0 || strcmp( arg, "--list" ) == 0 )
|
||||
|
|
@ -355,6 +370,7 @@ int main( int argc, char** argv )
|
|||
"-nc, --no-continuous: disable continuous collision\n"
|
||||
"-s, --record-steps: record step times\n"
|
||||
"-sat, --sat: compare GJK and SAT on hull pairs, then exit\n"
|
||||
"-simd, --simd-width=<4|8>: force the SIMD width (static Box3D only)\n"
|
||||
"-l, --list: list the registered benchmarks\n"
|
||||
"-h, --help: print this help\n" );
|
||||
exit( 0 );
|
||||
|
|
@ -371,6 +387,11 @@ int main( int argc, char** argv )
|
|||
}
|
||||
|
||||
#ifdef BOX3D_INTERNAL_BENCHMARKS
|
||||
if ( simdWidth != 0 )
|
||||
{
|
||||
SetSimdWidth( simdWidth );
|
||||
}
|
||||
|
||||
if ( runSat )
|
||||
{
|
||||
RunSatBenchmarks( runCount );
|
||||
|
|
@ -381,6 +402,9 @@ int main( int argc, char** argv )
|
|||
|
||||
printf( "Starting benchmarks\n" );
|
||||
printf( "======================================\n" );
|
||||
#ifdef BOX3D_INTERNAL_BENCHMARKS
|
||||
printf( "simd width = %d\n", GetSimdWidth() );
|
||||
#endif
|
||||
|
||||
for ( int benchmarkIndex = 0; benchmarkIndex < benchmarkCount; ++benchmarkIndex )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue