Prepare dph for a vectInfoVar type change
[packages/dph.git] / dph-prim-interface / Data / Array / Parallel / Unlifted.hs
1 {-# LANGUAGE TypeOperators, CPP #-}
2
3 -- | WARNING:
4 -- This is an abstract interface. All the functions will just `error` if called.
5 --
6 -- This module provides an API for the segmented array primitives used by DPH.
7 -- None of the functions here have implementations.
8 --
9 -- Client programs should use either the @dph-prim-seq@ or @dph-prim-par@
10 -- packages, as these provide the same API and contain real code.
11 --
12
13 -- NOTE: The API is enforced by the DPH_Header.h and DPH_Interface.h headers.
14 -- The dph-prim-interface, dph-prim-seq, and dph-prim-par modules all import
15 -- the same headers so we can be sure we're presenting the same API.
16
17 #include "DPH_Header.h"
18
19 import qualified Prelude as P
20 import Prelude ( Eq(..), Num(..), Bool(..), ($), (.) )
21
22 #include "DPH_Interface.h"
23
24
25 ------------------------------------------------------------------------------
26 notImplemented :: P.String -> a
27 notImplemented fnName
28 = P.error $ P.unlines
29 [ "dph-prim-interface:Data.Array.Parallel.Unlifted." P.++ fnName
30 , "This module is an abstract interface and does not contain real code."
31 , "Use dph-prim-seq or dph-prim-par instead." ]
32 {-# NOINLINE notImplemented #-}
33
34
35 -- Types ----------------------------------------------------------------------
36 class Elt a
37 instance Elt a => Elt [a]
38 type Array a = [a]
39
40
41 -- Constructors ---------------------------------------------------------------
42 empty = notImplemented "empty"
43 (+:+) = notImplemented "(+:+)"
44 append_s = notImplemented "append_s"
45 append_vs = notImplemented "append_vs"
46 replicate = notImplemented "replicate"
47 replicate_s = notImplemented "replicate_s"
48 replicate_rs = notImplemented "replicate_rs"
49 repeat = notImplemented "repeat"
50 indexed = notImplemented "indexed"
51 indices_s = notImplemented "indices_s"
52 enumFromTo = notImplemented "enumFromTo"
53 enumFromThenTo = notImplemented "enumFromThenTo"
54 enumFromStepLen = notImplemented "enumFromStepLen"
55 enumFromStepLenEach = notImplemented "enumFromStepLenEach"
56
57
58 -- Conversions ----------------------------------------------------------------
59 nest = notImplemented "nest"
60 toList = notImplemented "toList"
61 fromList = notImplemented "fromList"
62 toList_s = notImplemented "toList_s"
63 fromList_s = notImplemented "fromList_s"
64
65
66 -- Projections ----------------------------------------------------------------
67 length = notImplemented "length"
68 index = notImplemented "index"
69 indexs = notImplemented "indexs"
70 indexs_avs = notImplemented "indexs_avs"
71 extract = notImplemented "extract"
72 extracts_nss = notImplemented "extract_nss"
73 extracts_ass = notImplemented "extract_ass"
74 extracts_avs = notImplemented "extract_avs"
75 drop = notImplemented "drop"
76
77
78 -- Update ---------------------------------------------------------------------
79 update = notImplemented "update"
80
81
82 -- Permutation ----------------------------------------------------------------
83 permute = notImplemented "permute"
84 bpermute = notImplemented "bpermute"
85 mbpermute = notImplemented "mbpermute"
86 bpermuteDft = notImplemented "bpermuteDft"
87
88
89 -- Zipping and Unzipping ------------------------------------------------------
90 zip = notImplemented "zip"
91 zip3 = notImplemented "zip3"
92 unzip = notImplemented "unzip"
93 unzip3 = notImplemented "unzip3"
94 fsts = notImplemented "fsts"
95 snds = notImplemented "snds"
96
97
98 -- Map and zipWith ------------------------------------------------------------
99 map = notImplemented "map"
100 zipWith = notImplemented "zipWith"
101
102
103 -- Scans and Folds -----------------------------------------------------------
104 scan = notImplemented "scan"
105 fold = notImplemented "fold"
106 fold_s = notImplemented "fold_s"
107 fold_ss = notImplemented "fold_ss"
108 fold_r = notImplemented "fold_r"
109 fold1 = notImplemented "fold1"
110 fold1_s = notImplemented "fold1_s"
111 fold1_ss = notImplemented "fold1_ss"
112 sum = notImplemented "sum"
113 sum_r = notImplemented "sum_r"
114 and = notImplemented "and"
115
116
117 -- Packing and Combining ------------------------------------------------------
118 pack = notImplemented "pack"
119 filter = notImplemented "filter"
120 combine = notImplemented "combine"
121 combine2 = notImplemented "combine2"
122 interleave = notImplemented "interleave"
123
124
125 -- Selectors ------------------------------------------------------------------
126 data Sel2
127 = Sel2
128 { sel2_tags :: [Tag]
129 , sel2_indices :: [Int]
130 , sel2_elements0 :: Int
131 , sel2_elements1 :: Int }
132
133 type SelRep2 = ()
134
135 mkSel2 = notImplemented "mkSel2"
136 tagsSel2 = notImplemented "tagsSel2"
137 indicesSel2 = notImplemented "indicesSel2"
138 elementsSel2_0 = notImplemented "elementsSel2_0"
139 elementsSel2_1 = notImplemented "elementsSel2_1"
140 repSel2 = notImplemented "repSel2"
141
142 mkSelRep2 = notImplemented "mkSelRep2"
143 indicesSelRep2 = notImplemented "indicesSelRep2"
144 elementsSelRep2_0 = notImplemented "elementsSelRep2_0"
145 elementsSelRep2_1 = notImplemented "elementsSelRep2_1"
146
147
148 -- Segment Descriptors --------------------------------------------------------
149 data Segd
150 = Segd
151 { segd_lengths :: [Int]
152 , segd_indices :: [Int]
153 , segd_elements :: Int }
154
155 mkSegd = notImplemented "mkSegd"
156 emptySegd = notImplemented "emptySegd"
157 singletonSegd = notImplemented "singletonSegd"
158 validSegd = notImplemented "validSegd"
159 lengthSegd = notImplemented "lengthSegd"
160 lengthsSegd = notImplemented "lengthsSegd"
161 indicesSegd = notImplemented "indicesSegd"
162 elementsSegd = notImplemented "elementsSegd"
163
164
165 -- Scattered Segment Descriptors ----------------------------------------------
166 data SSegd
167 = SSegd
168 { ssegd_starts :: [Int]
169 , ssegd_sources :: [Int]
170 , ssegd_segd :: Segd }
171
172 mkSSegd = notImplemented "mkSSegd"
173 validSSegd = notImplemented "validSSegd"
174 emptySSegd = notImplemented "emptySSegd"
175 singletonSSegd = notImplemented "singletonSSegd"
176 promoteSegdToSSegd = notImplemented "promoteSegdToSSegd"
177 isContiguousSSegd = notImplemented "isContiguousSSegd"
178 lengthOfSSegd = notImplemented "lengthOfSSegd"
179 lengthsOfSSegd = notImplemented "lenghtsOfSSegd"
180 indicesOfSSegd = notImplemented "indicesOfSSegd"
181 startsOfSSegd = notImplemented "startsOfSSegd"
182 sourcesOfSSegd = notImplemented "sourcesOfSSegd"
183 getSegOfSSegd = notImplemented "getSegOfSSegd"
184 appendSSegd = notImplemented "appendSSegd"
185
186
187 -- Virtual Segment Descriptors ------------------------------------------------
188 data VSegd
189 = VSegd
190 { vsegd_vsegids :: [Int]
191 , vsegd_ssegd :: SSegd }
192
193 mkVSegd = notImplemented "mkVSegd"
194 validVSegd = notImplemented "validSSegd"
195 emptyVSegd = notImplemented "emptyVSegd"
196 singletonVSegd = notImplemented "singletonVSegd"
197 replicatedVSegd = notImplemented "replicatedVSegd"
198 promoteSegdToVSegd = notImplemented "promoteSegdToVSegd"
199 promoteSSegdToVSegd = notImplemented "promoteSSegdToVSegd"
200 isContiguousVSegd = notImplemented "isContiguousVSegd"
201 isManifestVSegd = notImplemented "isManifestVSegd"
202 lengthOfVSegd = notImplemented "lengthOfVSegd"
203 takeVSegidsOfVSegd = notImplemented "takeVSegidsOfVSegd"
204 takeVSegidsRedundantOfVSegd = notImplemented "takeVSegidsRedundantOfVSegd"
205 takeSSegdOfVSegd = notImplemented "takeSSegdOfVSegd"
206 takeSSegdRedundantOfVSegd = notImplemented "takeSSegdRedundantOfVSegd"
207 takeLengthsOfVSegd = notImplemented "takeLengthsOfVSegd"
208 getSegOfVSegd = notImplemented "getSegOfVSegd"
209 unsafeDemoteToSSegdOfVSegd = notImplemented "unsafeDemoteToSSegdOfVSegd"
210 unsafeDemoteToSegdOfVSegd = notImplemented "unsafeDemoteToSegdOfVSegd"
211 updateVSegsOfVSegd = notImplemented "updateVSegsOfVSegd"
212 updateVSegsReachableOfVSegd = notImplemented "updateVSegsReachableOfVSegd"
213 appendVSegd = notImplemented "appendVSegd"
214 combine2VSegd = notImplemented "combine2VSegd"
215
216
217 -- Irregular two dimensional arrays -------------------------------------------
218 class Elts a
219 type Arrays a
220 = [[a]]
221
222 emptys = notImplemented "emptys"
223 lengths = notImplemented "lengths"
224 singletons = notImplemented "singletons"
225 unsafeIndexs = notImplemented "unsafeIndexs"
226 unsafeIndex2s = notImplemented "unsafeIndex2s"
227 appends = notImplemented "appends"
228 fromVectors = notImplemented "fromVectors"
229 toVectors = notImplemented "toVectors"
230
231
232 -- Random Arrays --------------------------------------------------------------
233 randoms n = notImplemented "randoms"
234 randomRs n r = notImplemented "randomRs"
235
236
237 -- Array IO -------------------------------------------------------------------
238 class Elt a => IOElt a
239 hPut = notImplemented "hPut"
240 hGet = notImplemented "hGet"
241