Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unary stencil #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions accelerate-llvm/src/Data/Array/Accelerate/LLVM/CodeGen/Stencil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ stencilAccess sR mbndy arr =
-> (Operands sh -> IRExp arch aenv e)
-> Operands sh
-> IRExp arch aenv stencil
goR (StencilRunit1 _) rf ix
= tup1 <$> rf ix

goR (StencilRunit3 _) rf ix
= let (z, i) = unindex ix
rf' d = do d' <- A.add numType i (int d)
Expand Down Expand Up @@ -123,6 +126,13 @@ stencilAccess sR mbndy arr =
-- when we recurse on the stencil structure we must manipulate the
-- _left-most_ index component
--
goR (StencilRtup1 s1) rf ix =
let shr = stencilShapeR s1
(i, ix') = uncons shr ix
rf' ds = rf (cons shr i ds)
in
tup1 <$> goR s1 rf' ix'

goR (StencilRtup3 s1 s2 s3) rf ix =
let shr = stencilShapeR s1
(i, ix') = uncons shr ix
Expand Down Expand Up @@ -293,6 +303,9 @@ unindex (OP_Pair sh i) = (sh, i)
index :: Operands sh -> Operands Int -> Operands (sh, Int)
index sh i = OP_Pair sh i

tup1 :: Operands a -> Operands (Tup1 a)
tup1 a = OP_Pair OP_Unit a

tup3 :: Operands a -> Operands b -> Operands c -> Operands (Tup3 a b c)
tup3 a b c = OP_Pair (OP_Pair (OP_Pair OP_Unit a) b) c

Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ packages: accelerate-llvm

source-repository-package
type: git
location: https://github.com/AccelerateHS/accelerate.git
tag: 20cd26291f42b2ea74d4e9750301620f83f98b17
location: https://github.com/dpvanbalen/accelerate.git
tag: 704cb2548a97143655e713b78c240a479576f96a
-- Cabal builds from an sdist, and `accelerate.cabal` references files that
-- don't exist on a fresh clone. Cabal 3.8.0.0 will do this automatically.
-- XXX: For some reason cabal just stops when the command returns 0? So
Expand Down
4 changes: 2 additions & 2 deletions stack-8.10.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ packages:
- accelerate-llvm-ptx

extra-deps:
- github: AccelerateHS/accelerate
commit: 20cd26291f42b2ea74d4e9750301620f83f98b17
- github: dpvanbalen/accelerate
commit: 704cb2548a97143655e713b78c240a479576f96a

- cuda-0.10.2.0
- nvvm-0.10.0.0
Expand Down
4 changes: 2 additions & 2 deletions stack-8.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ packages:
- accelerate-llvm-ptx

extra-deps:
- github: AccelerateHS/accelerate
commit: 20cd26291f42b2ea74d4e9750301620f83f98b17
- github: dpvanbalen/accelerate
commit: 704cb2548a97143655e713b78c240a479576f96a

- cuda-0.10.2.0
- formatting-7.1.3
Expand Down
4 changes: 2 additions & 2 deletions stack-8.8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ packages:
- accelerate-llvm-ptx

extra-deps:
- github: AccelerateHS/accelerate
commit: 20cd26291f42b2ea74d4e9750301620f83f98b17
- github: dpvanbalen/accelerate
commit: 704cb2548a97143655e713b78c240a479576f96a

- cuda-0.10.2.0
- formatting-7.1.3
Expand Down
4 changes: 2 additions & 2 deletions stack-9.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ packages:
- accelerate-llvm-ptx

extra-deps:
- github: AccelerateHS/accelerate
commit: 20cd26291f42b2ea74d4e9750301620f83f98b17
- github: dpvanbalen/accelerate
commit: 704cb2548a97143655e713b78c240a479576f96a

- github: llvm-hs/llvm-hs
commit: 351683ed1c2f6b329e62439d42a158b1d804b846
Expand Down