필터 지우기
필터 지우기

min and max of gpuArray

조회 수: 4 (최근 30일)
Massimiliano Zanoli
Massimiliano Zanoli 2020년 10월 10일
편집: Matt J 2020년 10월 10일
Hi,
why does the following fail? I cannot find any caveat about GPU support of min/max on the documentation. Plus, the error message is really not helping. Maybe it has been solved in R2020?
Is there a way to obtain the linear index of the min/max without fecthing the array from the GPU ?
>> A = rand(3, 3, 3, 'gpuArray');
>> min(A, [], 'all')
ans =
0.0342
>> min(A, [], 'linear')
Error using gpuArray/min
Option must be 'all', 'linear', 'omitnan', or 'includenan'.
>> [minimum, index] = min(A, [], 'linear');
Error using gpuArray/min
Option must be 'all', 'linear', 'omitnan', or 'includenan'.
Thanks!

채택된 답변

Matt J
Matt J 2020년 10월 10일
편집: Matt J 2020년 10월 10일
I cannot find any caveat about GPU support of min/max on the documentation.
Check the "Extended Capabilities" section of doc min.
Maybe it has been solved in R2020?
Yes, it has.
Is there a way to obtain the linear index of the min/max without fecthing the array from the GPU ?
[minimum, index] = min(A(:));
or to operate along a specific dimension, use the attached function minlidx,
[minimum, index] = minlidx(A,dim);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by