Hi
When I execute my code, I get warnings and it seems that the CGen-generated function int64_t _toplength(StepRangeInt64Int64) causes these warnings.
FYI: bi2de() is a function that converts a binary array that LSB (least significant bit) is on the left to a decimal number.
FYI: You may test bi2de() with [0 1 0 1], like bi2de([0 1 0 1]) -> 10.
Here is my code:
using ParallelAccelerator
@acc function bi2de(binaryArray)
binaryArray = reshape(binaryArray, length(binaryArray));
z = 2 .^ (0:1:length(binaryArray)-1);
return sum(binaryArray .* z)
end
result = bi2de([0 1 1 1])
println(result)
And the warnings are:
/tmp/tmpBTdtGp/cgen_output9.cpp: In function ‘int64_t _toplength(StepRangeInt64Int64)’:
/tmp/tmpBTdtGp/cgen_output9.cpp:92:103: warning: right shift count >= width of type [-Wshift-count-overflow]
return (cgen_flipsign_int(((r.stop) - (r.start)) / (cgen_flipsign_int(GenSym0, GenSym0)), GenSym0) >> 63 == 0 ? cgen_flipsign_int(((r.stop) - (r.start)) / (cgen_flipsign_int(GenSym0, GenSym0)), GenSym0) : cgen_flipsign_int(((r.stop) - (r.start)) / (cgen_flipsign_int(GenSym0, GenSym0)), GenSym0)) + (1);
^ (<- In the Julia console, this hat is pointing the number 63)
/tmp/tmpBTdtGp/cgen_output9.cpp:97:103: warning: right shift count >= width of type [-Wshift-count-overflow]
return (cgen_flipsign_int(((r.start) - (r.stop)) / (cgen_flipsign_int(GenSym1, GenSym1)), GenSym1) >> 63 == 0 ? cgen_flipsign_int(((r.start) - (r.stop)) / (cgen_flipsign_int(GenSym1, GenSym1)), GenSym1) : cgen_flipsign_int(((r.start) - (r.stop)) / (cgen_flipsign_int(GenSym1, GenSym1)), GenSym1)) + (1);
^ (<- In the Julia console, this hat is pointing the number 63)
According to #104 , this warnings are not displayed with the July 12th version of ParallelAccelerator.
I would appreciate your comments.
FYI: Here is the CGen-generated function int64_t _toplength(StepRangeInt64Int64)
Hi When I execute my code, I get warnings and it seems that the CGen-generated function
int64_t _toplength(StepRangeInt64Int64)
causes these warnings.FYI:
bi2de()
is a function that converts a binary array that LSB (least significant bit) is on the left to a decimal number.FYI: You may test
bi2de()
with[0 1 0 1]
, likebi2de([0 1 0 1])
->10
.Here is my code:
And the warnings are:
According to #104 , this warnings are not displayed with the July 12th version of ParallelAccelerator.
I would appreciate your comments.
FYI: Here is the CGen-generated function
int64_t _toplength(StepRangeInt64Int64)