decimal to binary conversion of gpuArray gives error

1 visualización (últimos 30 días)
Harish Maradana
Harish Maradana el 11 de Dic. de 2014
Comentada: Harish Maradana el 11 de Dic. de 2014
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 comentarios
Geoff Hayes
Geoff Hayes el 11 de Dic. de 2014
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 el 11 de Dic. de 2014
[f,e]=log2(max(d)); % How many digits do we need to represent the numbers?

Iniciar sesión para comentar.

Respuestas (1)

Edric Ellis
Edric Ellis el 11 de Dic. de 2014
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?

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by