You must still do the copy, even (especially) if you are using 
USAGE_SHARED. It is not guaranteed to actually share memory for the 
bitmaps, so you are indeed not doing the necessary copies on the Nexux 6.

Steve

On Friday, June 10, 2016 at 3:18:32 AM UTC-7, Ruppesh Nalwaya wrote:
>
> Hi
> I started exploring the HelloComputeNDK example that uses Renderscript in 
> C++ to change the saturation of an image, converting it to gray image. I 
> noticed that after running the script on allocations, the output alloc is 
> copied to the outputPtr buffer, which is very "*time consuming operation"*. 
> I also noticed that the allocations are created with 
> RS_ALLOCATION_USAGE_SHARED 
> flag (I understand from this that buffer and allocation are sharing 
> memory). So I skipped the copying statements
>
> //inputAlloc->copy2DRangeFrom(0, 0, X, Y, inputPtr);
>
> //outputAlloc->copy2DRangeTo(0, 0, X, Y, outputPtr);
>
>
> This reduces the time of execution. This works on samsung galaxy s6. But on 
> nexus 6 phone, this *does not work*. I get a a blank image in case of nexus 
> 6. What is going wrong here. What is the proper way to avoid copying the 
> allocation to buffer and reduce the execution time.
>
>
> Thanks
>
> Ruppesh
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/727d6b21-beb6-4080-8d4a-136296335dbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to