IHn : (PureCRRec begin1' cr1) # n + (PureCRRec begin2' cr2) # n =
(PureCRRec (begin1' + begin2') p) # n
============================
(PureCRRec begin1' cr1) # n + (PureCRRec begin2' cr2) # n +
(cr1 # (S n) + cr2 # (S n)) =
(PureCRRec (begin1' + begin2') p) # n + p # (S n)
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
; Emulating cps call using LLVM Coroutines | |
; RUN: opt coro-cps.ll -O2 -enable-coroutines -S | |
define void @f(i32 %arg) { | |
entry: | |
%bar.ret.addr = alloca i32 | |
%id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null) | |
%size = call i32 @llvm.coro.size.i32() | |
%alloc = call i8* @malloc(i32 %size) | |
%hdl = call noalias i8* @llvm.coro.begin(token %id, i8* %alloc) |
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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE NoImplicitPrelude #-} | |
module Bytes where | |
import Prelude hiding ((>>)) | |
data Endian = Big | Little deriving(Eq, Ord) | |
data Interp = Signed | Unsigned deriving(Eq, Ord, Show) | |
instance Show Endian where | |
show Little = "L hi<-lo" |
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
╭─bollu@strangeattractor ~/work/asterius/asterius/rts ‹june-2-pass-numrun012-on-top-of-cgrun044*› | |
╰─$ stack build && stack test asterius:ghc-testsuite --test-arguments=" -p FloatFnInverses --timeout 30" ; cat /home/bollu/work/asterius/asterius/test-report.csv | |
Building all executables for `asterius' once. After a successful build of all of them, only specified executables will be rebuilt. | |
asterius-0.0.1: build (lib + exe) | |
Log files have been written to: /home/bollu/work/asterius/.stack-work/logs/ | |
-- While building package asterius-0.0.1 using: | |
/home/bollu/work/asterius/asterius/.stack-work/dist/x86_64-linux/Cabal-3.0.0.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-3.0.0.0 build lib:asterius exe:ahc exe:ahc-boot exe:ahc-cabal exe:ahc-dist exe:ahc-ld exe:ahc-link exe:ahc-pkg --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always" | |
Process exited with code: ExitFailure 1 | |
Logs have been written to: /home/bollu/work/asterius/.stack-work/logs/asterius-0.0.1.log |
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
[ | |
{ | |
"trPath": "test/ghc-testsuite/perf/T10359.hs", | |
"trOutcome": "TestFailure", | |
"trErrorMessage": "expected: RunSuccess\n but got: RunFailureγ\"EvalException {evalErrorMessage = \\\"file:///home/bollu/work/asterius/asterius/test/ghc-testsuite/perf/rts.integer.mjs:73\\\\n ? this.decode(bi).toString(Number(this.decode(b))).length - 1\\\\n ^\\\\n\\\\nTypeError: Cannot read property 'toString' of undefined\\\\n at IntegerManager.integerLogBase (file:///home/bollu/work/asterius/asterius/test/ghc-testsuite/perf/rts.integer.mjs:73:33)\\\\n at __asterius_jsffi_integerzmwiredzminzuGHCziIntegerziLogarithmsziInternals_5332261958806686639 (file:///home/bollu/work/asterius/asterius/test/ghc-testsuite/perf/T10359.lib.mjs:3:481)\\\\n at __asterius_jsffi_integerzmwiredzminzuGHCziIntegerziLogarithmsziInternals_5332261958806686639_wrapper (wasm-function[111]:4)\\\\n at base_GHCziFloat_zdwzdsfromRatzqzq_entry (wasm-function[1375]:341)\\\\n at |
This file has been truncated, but you can view the full file.
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
Module | |
{ sections = | |
[ TypeSection | |
{ types = | |
[ FunctionType { parameterTypes = [] , resultTypes = [] } | |
, FunctionType { parameterTypes = [] , resultTypes = [ I32 ] } | |
, FunctionType { parameterTypes = [ I32 ] , resultTypes = [] } | |
, FunctionType { parameterTypes = [ I32 ] , resultTypes = [ I32 ] } | |
, FunctionType { parameterTypes = [ I32 ] , resultTypes = [ F64 ] } | |
, FunctionType |
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 bash | |
NUM_PRAGMA_LINES=$(grep '!$ACC' -R openacc | wc -l) | |
NUM_FORTRAN_LINES=$(cloc openacc/*.f90 -csv | tail -1 | rev | cut -d',' -f 1 | rev) | |
echo "num pragma lines: " $NUM_PRAGMA_LINES | |
echo "total lines in opanacc: " $NUM_FORTRAN_LINES | |
echo "ratio:" | |
python -c "print(100.0 * float($NUM_PRAGMA_LINES) / $NUM_FORTRAN_LINES)" |
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 Control.Monad (forM_) | |
-- dual numbers of the form (x + ey), such that e^2 = 0. Formally, elements | |
-- of the ring (R[x] / x^2) | |
data Dual = Dual Double Double | |
instance Show Dual where | |
show (Dual x x') = "(" ++ show x ++ " + e" ++ show x' ++ ")" | |
-- create a differentiable dual quantity | |
-- has derivative 1 |
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
A[N][M][O] | |
A[x][y][z] = M * O * x + M * y + z | |
let y = O * 2 | |
A[x][O * 2][z] = M * O * x + M * (O * 2) + z = M * O * (x + 2) + M * 0 + z = A[x + 2][2][z] | |