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

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

9 Comments

Hi KALYAN ACHARJYA,
c= gf(randi(16,[row col pag di]),8);
Co1=double(c.x);
X1=(double(Packet)).*Co1;
co2=gf(randi(16,[row col pag di]),8);
C2=double(co2.x);
Y1=(double(Packet2)).*C2;
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.
Hi Walter Roberson
Thanks for answering me
This is my code..
Packet= (videoFrames(:,:,:,Begin:end1));
[row, col, pag, di]=size(Packet);
coefficient= gf(randi(GFin,[row col pag di]),8);
C1=(double(coefficient.x));
X1=gpuArray((((double(Packet)).*C1)));
Packet2= (videoFrames(:,:,:,end1+1:end));
[row2, col2, pag2, di2]=size(Packet2);
coefficient2=gf(randi(GFin,[row2 col2 pag2 di2]),8);
C2=(double(coefficient2.x));
Y1=gpuArray(((double(Packet2)).*C2));
z=bitxor(X1,Y1);
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 ?
Gfin is sometimes 4, 8
The equation I'm working on selects random numbers from GF.
Yes, video frames, it's uint8 .
Same setting. If I don't use gpuArray, no error message appears
The error message appears only when using gpuArray. Why?
What difference do you observe between selecting random numbers from gf and selecting random integers with the same maximum?
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?

Sign in to comment.

Answers (0)

Categories

Find more on Linear Algebra in Help Center and File Exchange

Tags

Asked:

on 12 Dec 2020

Commented:

on 18 Dec 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!