gputimeit
Time required to run function on GPU
Description
measures the typical time, in seconds, required to run the function specified by the
function handle t
= gputimeit(F
)F
. The function handle accepts no external input
arguments, but you can define it with input arguments to its internal function
call.
calls t
= gputimeit(F
,numOutputs
)F
with the desired number of output arguments,
numOutputs
. By default, gputimeit
calls the
function F
with one output argument, or no output arguments if
F
does not return any output.
Examples
Input Arguments
Limitations
The function
F
must not calltic
ortoc
.You cannot use
tic
andtoc
to measure the execution time ofgputimeit
itself.
Tips
gputimeit
is preferable to timeit
for functions that use the GPU, because it ensures that all operations on
the GPU have finished before recording the time and compensates for the overhead. For
operations that do not use a GPU, timeit
offers greater precision.
Extended Capabilities
Version History
Introduced in R2013b