max function in gpu error

조회 수: 3 (최근 30일)
wonji sim
wonji sim 2015년 8월 29일
답변: Edric Ellis 2015년 9월 1일
hello,
I want to use max function in arrayfun function.
I'm not familiar with using matlab in gpu.
My function is
[ maxv , dtree ]= arrayfun(@ GetRandomDecisionTree, rand_vec , rand_label , ClaNum , RandFnum , RandTnum , MinSampleNum , MaxDepth ) ;
and in GetRandomDecisionTree function
function [ DTreeMaxVec DTrees ] = GetRandomDecisionTree( Vec , ClaLabel , ClaNum , RandFnum , RandTnum , MinSampleNum , MaxDepth )
DTreeMaxVec = max(Vec);
end
Vec is matrix 50 * 500 size
but this code has error "Too few arguments supplied to: 'max'. (One supplied, two required.) "
I just want to get DTreeMaxVec 1*500 size, I don't want to use max(a,b).
help me please!

답변 (2개)

Edric Ellis
Edric Ellis 2015년 9월 1일
On the GPU, arrayfun supports only the elementwise version of min and max - i.e. the two input argument case. In this case, I think you'll need to call max outside your arrayfun invocation.

Walter Roberson
Walter Roberson 2015년 8월 30일
Which MATLAB release are you using? Before R2011b there were more limitations on gpu functions
  댓글 수: 2
wonji sim
wonji sim 2015년 8월 31일
편집: wonji sim 2015년 8월 31일
I'm using R2011b.
um.. I have more question . I want to run the Random Forest Tree in gpu. But I confirm that structure is not supported in gpu. Error message is "Struct field access or indexing is not supported." Is it right?
Walter Roberson
Walter Roberson 2015년 8월 31일
gpu arrays must be numeric or logical, not structures. However a structure (not on the GPU) may contain a gpu array object.
I do not seem to find any documentation about max on GPU.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by