]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/benchmark/nbody-simd/nbody-simd.factor
factor: trim using lists
[factor.git] / extra / benchmark / nbody-simd / nbody-simd.factor
index ee290b144dadd0ceacbe3181e9c35bdf078b9b92..c50481de5d08ecbe773cc45df3ca8d0f90bb62c5 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2008, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors alien.c-types fry kernel locals math
-math.constants math.functions math.vectors math.vectors.simd
-math.vectors.simd.cords math.parser combinators.smart sequences
-hints classes.struct specialized-arrays io ;
+USING: accessors alien.c-types kernel math math.constants
+math.functions math.vectors math.vectors.simd.cords math.parser
+combinators.smart sequences classes.struct specialized-arrays io ;
 IN: benchmark.nbody-simd
 
 : solar-mass ( -- x ) 4 pi sq * ; inline
@@ -17,7 +16,7 @@ STRUCT: body
 SPECIALIZED-ARRAY: body
 
 : <body> ( location velocity mass -- body )
-    [ days-per-year v*n ] [ solar-mass * ] bi* body <struct-boa> ; inline
+    [ days-per-year v*n ] [ solar-mass * ] bi* body boa ; inline
 
 : <jupiter> ( -- body )
     double-4{ 4.84143144246472090e00 -1.16032004402742839e00 -1.03622044471123109e-01 0.0 }
@@ -45,7 +44,7 @@ SPECIALIZED-ARRAY: body
 
 : <sun> ( -- body )
     double-4{ 0 0 0 0 } double-4{ 0 0 0 0 } 1 <body> ;
-    
+
 : offset-momentum ( body offset -- body )
     vneg solar-mass v/n >>velocity ; inline
 
@@ -98,6 +97,6 @@ SPECIALIZED-ARRAY: body
     [ '[ _ 0.01 advance ] times ]
     [ energy number>string print ] tri ;
 
-: nbody-main ( -- ) 1000000 nbody ;
+: nbody-simd-benchmark ( -- ) 1000000 nbody ;
 
-MAIN: nbody-main
+MAIN: nbody-simd-benchmark