Realised that allocating mobile arrays as arrays of bytes screws up the resize intrinsic, and gave it a helping hand
This commit is contained in:
parent
d3f4ff1a9a
commit
10b4cd7cfc
|
@ -1971,6 +1971,11 @@ cgenIntrinsicProc m "ASSERT" [A.ActualExpression e] = call genAssert m e
|
|||
cgenIntrinsicProc _ "RESCHEDULE" [] = call genReschedule
|
||||
cgenIntrinsicProc m s as = case lookup s intrinsicProcs of
|
||||
Just amtns -> do tell ["occam_", [if c == '.' then '_' else c | c <- s], "(wptr,"]
|
||||
when (s == "RESIZE.MOBILE.ARRAY.1D") $
|
||||
do let mob = head as
|
||||
A.Mobile (A.Array _ t) <- astTypeOf mob
|
||||
call genBytesIn m t (Left False)
|
||||
tell [","]
|
||||
seqComma [call genActual (A.Formal am t (A.Name emptyMeta n)) a
|
||||
| ((am, t, n), a) <- zip amtns as]
|
||||
tell [");"]
|
||||
|
|
|
@ -50,9 +50,9 @@ static inline void tock_init_chan_array (Channel *pointTo, Channel **pointFrom,
|
|||
//}}}
|
||||
|
||||
//{{{ mobile intrinsics
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, mt_array_t ** pptr, const int count) occam_unused;
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, mt_array_t ** pptr, const int count) {
|
||||
*pptr = MTResize1D (wptr, *pptr, count);
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, const int element_size, mt_array_t ** pptr, const int count) occam_unused;
|
||||
static inline void occam_RESIZE_MOBILE_ARRAY_1D (Workspace wptr, const int element_size, mt_array_t ** pptr, const int count) {
|
||||
*pptr = MTResize1D (wptr, *pptr, count*element_size);
|
||||
(*pptr)->dimensions[0] = count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user