How to check the Bytes of gpuArray?

1 visualización (últimos 30 días)
wei zhang
wei zhang el 15 de Feb. de 2021
Respondida: Matt J el 1 de Mzo. de 2021
Hi,
I am confusing in checking the Bytes of gpuArrays. It seems every varaible's Bytes is 4. Could I do something more to set it well? Or it is a windows or Geforce problem that I could not check it correctly?
x= 1:5;
xg = gpuArray(x);
xg32 = gpuArray(int32(x));
whos xg
% Name Size Bytes Class Attributes
% xg 1x5 4 gpuArray
whos xg32
% Name Size Bytes Class Attributes
% xg32 1x5 4 gpuArray

Respuesta aceptada

Edric Ellis
Edric Ellis el 15 de Feb. de 2021
Unfortunately, whos does not currently report the number of bytes used by a gpuArray on the GPU - the 4 bytes you see reported is the amount of CPU memory consumed. The number of bytes used by a gpuArray is essentially the same as the number of bytes used by the corresponding CPU array. (The only time this is not the case is for a non-square sparse gpuArray - the different sparse layouts makes a difference).

Más respuestas (1)

Matt J
Matt J el 1 de Mzo. de 2021
See whosGPU (Download).

Categorías

Más información sobre GPU Computing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by