Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update for Bool, Char

  • Loading branch information...
commit 2bd19599f61b9a71861307af839ade2f0769f5cf 1 parent eda6c96
Trevor L. McDonell tmcdonell authored

Showing 1 changed file with 5 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 5 Data/Array/Accelerate/IO/BlockCopy.hs
10 Data/Array/Accelerate/IO/BlockCopy.hs
@@ -23,7 +23,7 @@ module Data.Array.Accelerate.IO.BlockCopy (
23 23 import Foreign
24 24 import Foreign.C
25 25 import GHC.Base
26   -import Data.Array.Base (bOOL_SCALE, wORD_SCALE, fLOAT_SCALE, dOUBLE_SCALE)
  26 +import Data.Array.Base (wORD_SCALE, fLOAT_SCALE, dOUBLE_SCALE)
27 27 import Data.ByteString
28 28
29 29 -- friends
@@ -64,7 +64,7 @@ type instance BlockCopyFuns Word32 = BlockCopyFun Word32
64 64 type instance BlockCopyFuns Word64 = BlockCopyFun Word64
65 65 type instance BlockCopyFuns Float = BlockCopyFun Float
66 66 type instance BlockCopyFuns Double = BlockCopyFun Double
67   -type instance BlockCopyFuns Bool = BlockCopyFun Word8 -- Packed a bit vector
  67 +type instance BlockCopyFuns Bool = BlockCopyFun Word8
68 68 type instance BlockCopyFuns Char = BlockCopyFun Char
69 69 type instance BlockCopyFuns (a,b) = (BlockCopyFuns a, BlockCopyFuns b)
70 70
@@ -93,7 +93,7 @@ type instance BlockPtrs Word32 = Ptr Word32
93 93 type instance BlockPtrs Word64 = Ptr Word64
94 94 type instance BlockPtrs Float = Ptr Float
95 95 type instance BlockPtrs Double = Ptr Double
96   -type instance BlockPtrs Bool = Ptr Word8 -- Packed as a bit vector
  96 +type instance BlockPtrs Bool = Ptr Word8
97 97 type instance BlockPtrs Char = Ptr Char
98 98 type instance BlockPtrs (a,b) = (BlockPtrs a, BlockPtrs b)
99 99
@@ -164,8 +164,8 @@ blockCopyFunGenerator array@(Array _ arrayData) = aux arrayElt arrayData
164 164 aux ArrayEltRword64 ad = base (ptrsOfArrayData ad) (sizeA * 8)
165 165 aux ArrayEltRfloat ad = base (ptrsOfArrayData ad) (box fLOAT_SCALE sizeA)
166 166 aux ArrayEltRdouble ad = base (ptrsOfArrayData ad) (box dOUBLE_SCALE sizeA)
167   - aux ArrayEltRbool ad = base (ptrsOfArrayData ad) (box bOOL_SCALE sizeA)
168   - aux ArrayEltRchar _ = error "not defined yet" -- base (castPtr $ ptrsOfArrayData ad) (sizeA * 4)
  167 + aux ArrayEltRbool ad = base (ptrsOfArrayData ad) sizeA
  168 + aux ArrayEltRchar ad = base (ptrsOfArrayData ad) (sizeA * 4)
169 169 aux (ArrayEltRpair a b) (AD_Pair ad1 ad2) = ((bpFromC, bsFromC), (bpToC, bsToC), toH)
170 170 where
171 171 ((bpFromC1, bsFromC1), (bpToC1, bsToC1), toH1) = aux a ad1

0 comments on commit 2bd1959

Please sign in to comment.
Something went wrong with that request. Please try again.