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

 채택된 답변

Edric Ellis
Edric Ellis 2021년 2월 15일

0 개 추천

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).

추가 답변 (1개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 2월 15일

답변:

2021년 3월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by