User`s guide

pagefun
11-211
FUN must be a handle to a function that is written in the MATLAB language (i.e., not a
built-in function or a MEX-function).
Currently the supported values for FUN are:
Most element-wise gpuArray functions, listed in “Run Built-In Functions on a GPU ”,
and the following:
@ctranspose
@fliplr
@flipud
@inv
@mldivide (for square matrix divisors of sizes up to 32-by-32)
@mrdivide (for square matrix divisors of sizes up to 32-by-32)
@mtimes
@rot90
@transpose
Examples
M = 3; % output number of rows
K = 6; % matrix multiply inner dimension
N = 2; % output number of columns
P1 = 10; % size of first page dimension
P2 = 17; % size of second page dimension
P3 = 4; % size of third page dimension
P4 = 12; % size of fourth page dimension
A = rand(M,K,P1,1,P3,'gpuArray');
B = rand(K,N,1,P2,P3,P4,'gpuArray');
C = pagefun(@mtimes,A,B);
s = size(C) % M-by-N-by-P1-by-P2-by-P3-by-P4
s =
3 2 10 17 4 12
M = 300; % output number of rows
K = 500; % matrix multiply inner dimension
N = 1000; % output number of columns
P = 200; % number of pages
A = rand(M,K,'gpuArray');