When the input is gpuArray for bitxor function I get this error. How I solve it?
Show older comments
When the input is gpuArray for bitxor function I get this error. How I solve it?

9 Comments
KALYAN ACHARJYA
on 13 Dec 2020
>>whos X1
>>whos X2
Please provide?
amenah mwuafaq
on 13 Dec 2020
Walter Roberson
on 13 Dec 2020
Well those are both clearly datatype double(), and bitxor() requires that at least one of the two inputs be an integer class (the other can be either the same integer class or can be a scalar double.)
We do not know what range Packet and Packet2 are so we cannot guess which value range X1 and X2 are.
amenah mwuafaq
on 16 Dec 2020
Walter Roberson
on 16 Dec 2020
It looks like GFin is probably 16. In that case, when you take the x property of the gf() result, you are going to get uint32() of the result of the randi() . What is the purpose of going through the gf() step ?
Is it correct that class(videoFrames) is uint8 ?
It looks to me as if you are effectively working with 12 bit integers? uint8 video data, times random value that is up to 16, so maximum 4080 ?
amenah mwuafaq
on 17 Dec 2020
Walter Roberson
on 17 Dec 2020
What difference do you observe between selecting random numbers from gf and selecting random integers with the same maximum?
amenah mwuafaq
on 17 Dec 2020
Walter Roberson
on 18 Dec 2020
How do you propose to choose random numbers from a gf?
If you have an array named data that is nonnegative integers in the range 0 to 255, and you have
g = gf(data, 8)
Now you want to pick a random element from g
idx = randi(numel(g))
rg = g(idx)
rgfd = gf(data(idx), 8)
Are you expecting that rg and rgfd would be different?
Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!