This file contains 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.List | |
import System.IO | |
say :: Integer -> Integer | |
say = read . concatMap saygroup . group . show | |
where saygroup s = (show $ length s) ++ [head s] | |
look_and_say :: [Integer] | |
look_and_say = 1 : map say look_and_say | |
pr (x,y) = do |
This file contains 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
{- | |
ghc --make -Odph -fllvm -optlo-globalopt -optlo-loop-unswitch -optlo-mem2reg -optlo-prune-eh -O2 -fllvm -optl-O3 -rtsopts lookandsay.hs | |
time ./lookandsay > /dev/null | |
./lookandsay > /dev/null 6,02s user 0,24s system 99% cpu 6,284 total | |
-} | |
import System.IO | |
import Control.DeepSeq | |
data S = S1 | S2 | S3 -- deriving (Eq,Show,Read,Ord,Enum) |
This file contains 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
__cuda_local_var_212953_15_non_const_tmp = | |
((((__T2408 = (((const float3 *)(&(__cuda_local_var_212940_13_non_const_ray.current_point)))->x)) | |
, ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) | |
* __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * | |
((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * | |
__T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) | |
* __T2408) * __T2408) - (1.0F))) - __T2408)) - ((((2.0F) * __T2408) * __T2408) - | |
(1.0F)))) - ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - (1.0F))) - __T2408))) | |
- ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - | |
(1.0F))) - __T2408)) - ((((2.0F) * __T2408) * __T2408) - (1.0F))))) - ((((2.0F) * |
This file contains 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
[code]__cuda_local_var_212953_15_non_const_tmp = ((((__T2408 = (((const float3 *)(&(__cuda_local_var_212940_13_non_const_ray.current_point)))->x)) , ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - (1.0F))) - __T2408)) - ((((2.0F) * __T2408) * __T2408) - (1.0F)))) - ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - (1.0F))) - __T2408))) - ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - (1.0F))) - __T2408)) - ((((2.0F) * __T2408) * __T2408) - (1.0F))))) - ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * __T2408) - (1.0F))) - __T2408)) - ((((2.0F) * __T2408) * __T2408) - (1.0F)))) - ((((2.0F) * __T2408) * ((((2.0F) * __T2408) * _ |
This file contains 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 program uses the host CURAND API to generate 100 | |
* pseudorandom floats. | |
* | |
* Code taken verbatim from CURAND library documentation. | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <cuda.h> | |
#include <curand.h> | |
#define CUDA_CALL(x) do { if((x) != cudaSuccess) { \ |
This file contains 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
#!/usr/bin/env runhaskell | |
-- This is a simple script to convert .a libs into .so ones. | |
-- More specifically I used it to convert static libs from LLVM for usage with GHCi. | |
import System.Directory | |
import System.FilePath | |
import System.Process | |
import Control.Applicative | |
import Data.List ( isSuffixOf ) |
NewerOlder