MATLAB PARALLEL COMPUTING TOOLBOX - S Betriebsanweisung Seite 478

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 656
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 477
11 Functions — Alphabetical List
11-134
gputimeit
Time required to run function on GPU
Syntax
t = gputimeit(F)
t = gputimeit(F,N)
Description
t = gputimeit(F) measures the typical time (in seconds) required to run the function
specified by the function handle F. The function handle accepts no external input
arguments, but can be defined with input arguments to its internal function call.
t = gputimeit(F,N) calls F to return N output arguments. By default, gputimeit
calls the function F with one output argument, or no output arguments if F does not
return any output.
Examples
Measure the time to calculate sum(A.' .* B, 1) on a GPU, where A is a 12000-by-400
matrix and B is 400-by-12000.
A = rand(12000,400,'gpuArray');
B = rand(400,12000,'gpuArray');
f = @() sum(A.' .* B, 1);
t = gputimeit(f)
0.0026
Compare the time to run svd on a GPU, with one versus three output arguments.
X = rand(1000,'gpuArray');
f = @() svd(X);
t3 = gputimeit(f,3)
1.0622
Seitenansicht 477
1 2 ... 473 474 475 476 477 478 479 480 481 482 483 ... 655 656

Kommentare zu diesen Handbüchern

Keine Kommentare