decimal to binary conversion of gpuArray gives error

조회 수: 1 (최근 30일)
Harish Maradana
Harish Maradana 2014년 12월 11일
댓글: Harish Maradana 2014년 12월 11일
my code:
dc=60;
dc=gpuArray(dc);
s=dec2bin(dc);
when exicuting this code error:
[f,e]=log2(max(d)); % How many digits do we need to represent the numbers?
s=de2bi(dc) % also gives error
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2014년 12월 11일
Harish - if errors are being generated, then please include them in your question. Copy and paste all of the red text (that corresponds to the error) into your question.
Harish Maradana
Harish Maradana 2014년 12월 11일
[f,e]=log2(max(d)); % How many digits do we need to represent the numbers?

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

답변 (1개)

Edric Ellis
Edric Ellis 2014년 12월 11일
Unfortunately, as you have discovered, the gpuArray version of log2 doesn't support the second output argument as needed by dec2bin. One further problem is that dec2bin returns char data which is not supported on the GPU, so I think you might be better off simply gathering the GPU data before calling dec2bin.
Could I ask - are you calling dec2bin with a large amount of data?

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by