You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
actor fold() int img1 ==> int my_histogram :
int hist[255][255][255];
int height = 512;
int width = 256;
int i := 0;
fold: action img1:[r,g,b] ==>
guard i < (height * width)
do
hist[r][g][b] := hist[r][g][b] + 1;
i := i+1 ;
end
send: action ==> my_histogram:[[hist[r][g][b] : for int r in 0 .. 254, for int g in 0 .. 254, for int b in 0 .. 254 ]] repeat (255 * 255 * 255)
do
i := 0;
end
schedule fsm fold:
fold (fold) --> fold;
fold (send) --> send;
send (fold) --> fold;
end
priority fold > send;
end
end
I'm getting the following error when attempting to compile with Xronos:
Thanks. The dimensionality of the hist array is constrained by the nature of 3-element vector RGB values, each with a range from 0 to 255, i.e. within 16 bit range. If I rewrite for constructing a histogram over grey images, i.e. a 1 element vector for each pixel, then Xronos can compile the following code:
actor fold_grey() uint(size=16) img1 ==> uint(size=16) my_histogram :
uint(size=16) hist[255];
uint(size=16) height = 512;
uint(size=16) width = 256;
int i := 0;
fold: action img1:[grey] ==>
guard i < (height * width)
do
hist[grey] := hist[grey] + 1;
i := i+1 ;
end
send: action ==> my_histogram:[[hist[grey] : for uint(size=16) grey in 0 .. 254 ]] repeat (255)
do
i := 0;
end
schedule fsm fold:
fold (fold) --> fold;
fold (send) --> send;
send (fold) --> fold;
end
priority fold > send;
end
end
Hi Endri,
Given this actor:
I'm getting the following error when attempting to compile with Xronos:
I suspect it is to do with the output pattern for the
send
action, i.e.The text was updated successfully, but these errors were encountered: