Pagemldivide returns incorrect results for complex gpuArrays
Show older comments
A1=randn(20,10,2)+1j*randn(20,10,2);
B1=randn(20,10,2)+1j*randn(20,10,2);
A = gpuArray(A1);
B = gpuArray(B1);
X = pagemldivide(A,B);
x=mldivide(A(:,:,1),B(:,:,1));
X(:,:,1)-x
Am I missing something obvious here, or is this a bug? I first assumed this is related to pagemldivide and pagefun(@mldivide,...) for gpuArray inputs return incorrect results for rectangular pages when singleton dimension expansion is required (4237666) but there is no singleton dimension here.
6 Comments
Please show the outputs of:
D = gather(X(:,:,1) - x);
mxd = max(abs(D(:)))
relerr = norm(D,'fro') ./ norm(x,'fro')
Matti
on 30 Jun 2026 at 11:47
A = randn(20,10,2)+1j*randn(20,10,2);
pagemldivide(A,A)
Torsten
on 30 Jun 2026 at 13:03
Does this work for A being a gpuArray ?
I thought the code was intended as an example contradicting OP's second example. But without A being a gpuArray, I don't understand why you posted it. Or does it work with your home licence ?
Accepted Answer
More Answers (0)
Categories
Find more on Programming 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!