This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE CPP #-} | |
-- Naive translation of shen_anova1_batch.m into Accelerate. | |
module Main (main) where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Complex | |
-- This should be the biggest representable double: | |
big :: Double | |
big = 1.7976931348623157e308 | |
-- This uses OCaml's approach at overflow-avoidance: | |
mag :: Complex Double -> Double | |
mag (x:+y) = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> module Main where | |
How to write hybrid CPU/GPU programs with Haskell | |
------------------------------------------------- | |
What's better than programming a GPU with a high-level, | |
Haskell-embedded DSL (domain-specific-language)? Well, perhaps | |
writing portable CPU/GPU programs that utilize both pieces of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes, GeneralizedNewtypeDeriving, CPP #-} | |
import Data.Vector.Mutable as MV | |
import qualified Data.Vector as V -- ((!), freeze) | |
import Control.Monad.ST | |
import Control.Monad.Primitive | |
import Prelude hiding (read) | |
type Splitter a = a -> (a,a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is the average latency as measured by a single trial run of 100K ping/pongs with several different transports. | |
PingTCP: 7.34s >80%CPU | |
PingTCPTransport: 19s ~60%CPU | |
PingPipes: 6.36s >=100%CPU | |
The machine is a 3.1 ghz Intel Westmere (Dell workstation) running RHEL 6.2. | |
The PingTCP is a baseline that uses the raw Network.Socket interface rather than the Network.Transport abstraction. |
NewerOlder