简体   繁体   English

android renderscript堆栈大小太小

[英]android renderscript stack size too small

I need a large data buffer within my render script root method to process some data. 我的渲染脚本根方法中需要一个大数据缓冲区来处理一些数据。 For example, a large float array to store temp values. 例如,一个大的float数组用于存储临时值。 For that reason I just put a large array on the stack. 因此,我只是在堆栈上放置了一个大型数组。 This works fine as long the data buffer don't gets too big 只要数据缓冲区不要太大就可以了

Each of my root calls need its own buffer to do the calculation. 我的每个root调用都需要有自己的缓冲区来进行计算。 If I got it correctly the root method can run in parallel and so its not possible to allocate this buffer from java since this would be shared between all running root methods, right? 如果我正确地获得了它,则根方法可以并行运行,因此不可能从Java分配此缓冲区,因为它将在所有正在运行的根方法之间共享,对吗?

Any idea how to allocate or access a local data buffer in the root method? 知道如何在root方法中分配或访问本地数据缓冲区吗? Or is it not possible? 还是不可能?

The size of the available size seams to be depending on the device/Android version. 可用大小的接缝大小取决于设备/ Android版本。 Is there a way to get the stack size on the current device? 有没有办法获取当前设备上的堆栈大小?

(And yes its probably possible to split the job further so that it needs less buffer space but that would change the currently running algorithm completely and I would first try to find another solution.) (是的,可能有可能进一步拆分工作,以便它需要更少的缓冲区空间,但这将完全改变当前正在运行的算法,因此我将首先尝试寻找另一种解决方案。)

RenderScript doesn't support allocating memory within the script itself. RenderScript不支持在脚本本身内分配内存。 It's all managed and bound by the Java (or NDK) side. 它全部由Java(或NDK)端管理和约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM