Memory model Sample Clauses
Memory model. Renderscript uses a split memory model. Any memory to be used in parallel code must be explicitly allocated from serial code and initialized if necessary. If a memory object is used by parallel Renderscript code, subsequent attempts to use it from serial code trigger a synchronization event. Compilation Model. Renderscript code is compiled to an intermediate representation at compile time. At run time it translated into machine code for the specific machine it is running on. Minimum Steps Needed to Run Parallel Code. Renderscript has some explicit context and memory management requirements:
Memory model. Memory architectures have a significant effect on the programming model. While this is the most convenient model for the programmer it excludes the use of parallel processors with segmented memory architectures, which includes most of the massively parallel processors. Programming models will typically allow the program to define blocks of shared memory that have matching allocations on both the serial processor memory and parallel processor memory. Some programming models require the programmer to explicitly copy data between the different memory segments at the right time. Other models will automatically copy the data to where it is needed, in which case there must be a mechanism for describing whether memory is an input to the parallel code, output from the parallel code or both. Private memory Each thread has its own stack but some models also provide access to private memory which is additional local memory for each individual thread. This memory is uninitialized when the thread starts and is discarded when the thread ends and can therefore be used only as temporary storage. In many architectures this memory is significantly faster than other memory and can be used to store intermediate results that are too large to be held in registers. Some programming models allow efficient copying of data between the different types of memory in a segmented memory system and, in particular, efficient copying of data into local memory. This can take advantage of any acceleration hardware in the parallel processor.
