<commit_before>#!/usr/bin/env runghc
{-# LANGUAGE NamedFieldPuns #-}

-- | This script runs all Harlan benchmarks.  It is based on a Haskell
-- benchmarking framework called HSBencher.  Its main advantage is
-- that it supports uploading of benchmark timings to a Google Fusion
-- Table.

-- Requires hsbencher >= 0.2

import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import System.Directory
import System.FilePath
import System.Exit
import System.Environment (getArgs)
import System.Process
import GHC.Conc (getNumProcessors)
import System.IO.Unsafe (unsafePerformIO)
import Debug.Trace

import HSBencher (defaultMainModifyConfig)
import HSBencher.Types
import HSBencher.Methods (makeMethod)
import HSBencher.Logging (log)
import HSBencher.MeasureProcess
import HSBencher.Utils (runLogged, defaultTimeout)
import Prelude hiding (log)
--------------------------------------------------------------------------------

main :: IO ()
main = defaultMainModifyConfig myconf

all_benchmarks :: [Benchmark DefaultParamMeaning]
all_benchmarks =
  [  mkBenchmark "ReductionTutorial/Reduce.cabal" [variant,cudaThreads,elems] defaultCfgSpc
  | variant     <- ["r1", "r2", "r3", "r4", "r5", "r6" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , elems       <- [ show (2^n) | n <- [8..15] ] -- 256 to 32768
  ] ++
  [  mkBenchmark "ReductionTutorial/Reduce.cabal" [variant,kernel,cudaThreads] defaultCfgSpc
  | variant     <- ["large" ]
  , kernel      <- ["r1", "r2", "r3", "r4", "r5", "r6" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  ] ++ 
  [  mkBenchmark "ScanBench/Scan.cabal" [variant,cudaThreads,elems] defaultCfgSpc
  | variant     <- ["s1", "s2", "s3" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , elems       <- [ show (2^n) | n <- [8..15] ] -- 256 to 32768
  ] ++
  [  mkBenchmark "FractalBench/Fractals.cabal" [cudaThreads,size] defaultCfgSpc
  | cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , size       <- [ show (2^n) | n <- [8..13] ] -- 256x256 to 8192x8192
  ]

-- | Default configuration space over which to vary settings:
--   This is a combination of And/Or boolean operations, with the ability
--   to set various environment and compile options.
defaultCfgSpc = And []
  where
--   gpu = And [ Set (Variant "GPU") (RuntimeEnv "HARLAN_DEVICE" "gpu") ]


-- | Here we have the option of changing the HSBencher config
myconf :: Config -> Config
myconf conf =
  conf
   { benchlist = all_benchmarks
   }
<commit_msg>Add r7 to run_benchmarks<commit_after>#!/usr/bin/env runghc
{-# LANGUAGE NamedFieldPuns #-}

-- | This script runs all Harlan benchmarks.  It is based on a Haskell
-- benchmarking framework called HSBencher.  Its main advantage is
-- that it supports uploading of benchmark timings to a Google Fusion
-- Table.

-- Requires hsbencher >= 0.2

import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import System.Directory
import System.FilePath
import System.Exit
import System.Environment (getArgs)
import System.Process
import GHC.Conc (getNumProcessors)
import System.IO.Unsafe (unsafePerformIO)
import Debug.Trace

import HSBencher (defaultMainModifyConfig)
import HSBencher.Types
import HSBencher.Methods (makeMethod)
import HSBencher.Logging (log)
import HSBencher.MeasureProcess
import HSBencher.Utils (runLogged, defaultTimeout)
import Prelude hiding (log)
--------------------------------------------------------------------------------

main :: IO ()
main = defaultMainModifyConfig myconf

all_benchmarks :: [Benchmark DefaultParamMeaning]
all_benchmarks =
  [  mkBenchmark "ReductionTutorial/Reduce.cabal" [variant,cudaThreads,elems] defaultCfgSpc
  | variant     <- ["r1", "r2", "r3", "r4", "r5", "r6", "r7" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , elems       <- [ show (2^n) | n <- [8..15] ] -- 256 to 32768
  ] ++
  [  mkBenchmark "ReductionTutorial/Reduce.cabal" [variant,kernel,cudaThreads] defaultCfgSpc
  | variant     <- ["large" ]
  , kernel      <- ["r1", "r2", "r3", "r4", "r5", "r6", "r7" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  ] ++ 
  [  mkBenchmark "ScanBench/Scan.cabal" [variant,cudaThreads,elems] defaultCfgSpc
  | variant     <- ["s1", "s2", "s3" ]
  , cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , elems       <- [ show (2^n) | n <- [8..15] ] -- 256 to 32768
  ] ++
  [  mkBenchmark "FractalBench/Fractals.cabal" [cudaThreads,size] defaultCfgSpc
  | cudaThreads <- [ show (2^n) | n <- [5..10] ] -- 32 to 1024y
  , size       <- [ show (2^n) | n <- [8..13] ] -- 256x256 to 8192x8192
  ]

-- | Default configuration space over which to vary settings:
--   This is a combination of And/Or boolean operations, with the ability
--   to set various environment and compile options.
defaultCfgSpc = And []
  where
--   gpu = And [ Set (Variant "GPU") (RuntimeEnv "HARLAN_DEVICE" "gpu") ]


-- | Here we have the option of changing the HSBencher config
myconf :: Config -> Config
myconf conf =
  conf
   { benchlist = all_benchmarks
   }

{'fraction_non_alphanumeric': 0.1672869735553379, 'fraction_numerical': 0.039764936336924586, 'mean_word_length': 2.982839313572543, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2729120', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1775, 'n_words': 493}