PAGEFUN always extracts pages by indexing the 3rd dimension. In other words the |i|-th page is always obtained as if by doing |A(:,:,i)|. If A happens to have more than 3 dimensions, then |i| is treated as a linear index. If A has fewer than 3 dimensions, then it is effectively replicated along the 3rd dimension, so that it has the same number of pages as the other arguments. Answer from Matt J on mathworks.com
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
pagefun - Apply function to each page of distributed or GPU array - MATLAB
[A1,...,Am] = pagefun(FUN,___) returns multiple output arrays A1,...,Am when the function FUN returns m output values. pagefun calls FUN each time with as many outputs as there are in the call to pagefun, that is, m times. If you call pagefun with more output arguments than supported by FUN, ...
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
Improve Performance of Small Matrix Problems on the GPU Using pagefun - MATLAB & Simulink Example
The pagefun function supports applying most element-wise functions and a number of matrix operations that support GPU array input. MATLAB® also provides a number of dedicated page-wise functions, including pagemtimes, pagemldivide, pagemrdivide, pagetranspose, pagectranspose, pageinv, pagenorm, ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 352698-what-functions-does-pagefun-support
What functions does pagefun support? - MATLAB Answers - MATLAB Central
August 14, 2017 - The main missing pagefun functions are other batch BLAS and LAPACK operations like non-square mldivide, and svd. Also, some people ask us to relax the restrictions that all the matrices be the same size. ... https://www.mathworks.com/matlabcentral/answers/352698-what-functions-does-pagefun-support#comment_477242
🌐
MathWorks
mathworks.com › matlabcentral › answers › 304649-how-can-i-use-pagefun
How can I use pagefun? - MATLAB Answers - MATLAB Central
September 27, 2016 - function gputest() % pagefun function res = ttt_gpu(bb) res = bb + 1; end b = gpuArray(repmat([1 2 ; 2 2; 4 3], 1, 1, 3)); pagefun(@ttt_gpu, b) en...
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
Apply function to each page of array on GPU - MATLAB pagefun
A = pagefun(FUN,B) applies the function specified by FUN to each page of the gpuArray B, and returns the results in gpuArray A, such that A(:,:,I,J,...) = FUN(B(:,:,I,J,...)). FUN is a handle to a function that takes a two-dimensional input argument. You can use gather to retrieve the array ...
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
Apply function to each page of distributed or GPU array - MATLAB pagefun
A = pagefun(FUN,B1,...,Bn) evaluates FUN using pages of the arrays B1,...,Bn as input arguments with scalar expansion enabled. Any of the input page dimensions that are scalar are virtually replicated to match the size of the other arrays in that dimension so that A(:,:,I,J,...) = ...
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
Apply function to each page of distributed array or gpuArray - MATLAB pagefun
[A1,...,Am] = pagefun(FUN,___) returns multiple output arrays A1,...,Am when the function FUN returns m output values. pagefun calls FUN each time with as many outputs as there are in the call to pagefun, that is, m times. If you call pagefun with more output arguments than supported by FUN, ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1713425-fastest-way-for-page-wise-computation-for-vs-arrayfun-vs-pagefun
Fastest way for page-wise computation - FOR vs ARRAYFUN vs PAGEFUN - MATLAB Answers - MATLAB Central
May 6, 2022 - What GPU do you have? I suspect pagefun will be faster if you process in single precision. Sign in to comment. Sign in to answer this question. Sign in to answer this question. MATLAB Language Fundamentals Matrices and Arrays Matrix Indexing
Find elsewhere
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1630505-error-using-pagefun-with-mldivide
Error using pagefun with mldivide - MATLAB Answers - MATLAB Central
January 17, 2022 - Error using pagefun with mldivide. Learn more about gpu, pagefun, mldivide, cuda, error, cublas, gpuarray MATLAB, Parallel Computing Toolbox
🌐
MathWorks
mathworks.com › matlabcentral › answers › 478617-multi-dimensional-matrix-multiplication-gpu-and-pagefun-seem-slow
multi dimensional matrix multiplication: GPU and pagefun seem slow? - MATLAB Answers - MATLAB Central
September 2, 2019 - https://www.mathworks.com/matlabcentral/answers/478617-multi-dimensional-matrix-multiplication-gpu-and-pagefun-seem-slow#comment_741532
🌐
MathWorks
mathworks.com › parallel computing toolbox › gpu computing › gpu computing in matlab
pagefun
[A1,...,Am] = pagefun(FUN,___) returns multiple output arrays A1,...,Am when the function FUN returns m output values. pagefun calls FUN each time with as many outputs as there are in the call to pagefun, that is, m times. If you call pagefun with more output arguments than supported by FUN, ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 362389-gpu-imadjust-pagefun-workaround
GPU imadjust pagefun workaround - MATLAB Answers - MATLAB Central
October 26, 2017 - I have passed along a request for pagefun to support imadjust to our development team. It will be considered for future releases of MATLAB.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 304641-pagefun-makes-an-error
pagefun makes an error - MATLAB Answers - MATLAB Central
The following code makes an error. How can I solve it? b = gpuArray(repmat([1 2 ; 2 2; 4 3], 1, 1, 3)); pagefun(@norm, b) Error using gpuArray/pagefun Function passed as first input arg...
🌐
MathWorks
blogs.mathworks.com › matlab › 2024 › 05 › 29 › paged-matrix-functions-in-matlab-2024-edition
Paged Matrix Functions in MATLAB (2024 edition) » The MATLAB Blog - MATLAB & Simulink
May 29, 2024 - Back in 2021, Loren Shure posted an article that introduced the first page-wise matrix functions in MATLAB: A page-wise matrix multiply pagemtimes, along with page-wise transpose pagetranspose, and complex conjugate transpose pagectranspose; all of which were added to MATLAB R2020b.