Specifying page dimensions in pagefun()
Afficher commentaires plus anciens
Is there a way to indicate which pages are specified in the pagefun() function?
For example, I have three arrays--A, B and C--with size(A) = [a,b,d],size(B) = [b,c,d], and size(C) = [a,c,d]. I would like to optimize the following code:
sol = zeros(a,d);
for ii = 1:d
temp = A(:,:,ii) * B(:,:,ii);
sol(:,ii) = sum(C(:,:,ii) .* temp,2);
end
Using pagefun() and arrayfun(), if possible, on the GPU (note: it currently runs fine on the GPU as is by casting A/B/C as gpuArrays, I'm looking to optimize). I haven't found any good documentation for how pagefun() chooses which pages to apply to. In this example, A and B share two similar dimensions (a and d), but I believe we only want the computation done over the third dimension (d). How is pagefun() applied in this case?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur GPU Computing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!