# Print output for @column tags ?>
  public
  
  final
  
  class
  ScriptGroup
  
  
  
  
    extends BaseObj
  
  
  
  
  
  
| java.lang.Object | ||
| ↳ | android.renderscript.BaseObj | |
| ↳ | android.renderscript.ScriptGroup | |
A group of kernels that are executed together with one execution call as if they were a single kernel
In addition to kernels, a script group may contain invocable functions as well. A script group may take inputs and generate outputs, which are consumed and produced by its member kernels. Inside a script group, outputs from one kernel can be passed to another kernel as inputs. The API disallows cyclic dependencies among kernels in a script group, effectively making it a directed acyclic graph (DAG) of kernels.
Grouping kernels together allows for more efficient execution. For example, runtime and compiler optimization can be applied to reduce computation and communication overhead, and to make better use of the CPU and the GPU.
| Nested classes | |
|---|---|
| 
        
        
        
        
        class | ScriptGroup.BindingRepresents a binding of a value to a global variable in a kernel or invocable function. | 
| 
        
        
        
        
        class | ScriptGroup.Builder
      This class is deprecated.
    Use  | 
| 
        
        
        
        
        class | ScriptGroup.Builder2The builder class for creating script groups 
 A script group is created using closures (see class  | 
| 
        
        
        
        
        class | ScriptGroup.ClosureAn opaque class for closures A closure represents a function call to a kernel or invocable function, combined with arguments and values for global variables. | 
| 
        
        
        
        
        class | ScriptGroup.FutureAn opaque class for futures A future represents an output of a closure, either the return value of the function, or the value of a global variable written by the function. | 
| 
        
        
        
        
        class | ScriptGroup.InputAn opaque class for script group inputs 
 Created by calling the  | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      destroy()
      Destroy this ScriptGroup and all Closures in it | 
| 
        
        
        
        
        
        void | 
      execute()
      
      This method is deprecated.
    Use  | 
| 
        
        
        
        
        
        Object[] | 
      execute(Object... inputs)
      Executes a script group | 
| 
        
        
        
        
        
        void | 
      setInput(Script.KernelID s, Allocation a)
      
      This method is deprecated.
    Set arguments to  | 
| 
        
        
        
        
        
        void | 
      setOutput(Script.KernelID s, Allocation a)
      
      This method is deprecated.
    Use return value of  | 
| Inherited methods | |
|---|---|
public void destroy ()
Destroy this ScriptGroup and all Closures in it
public void execute ()
      This method is deprecated.
    Use execute() instead.
  
Execute the ScriptGroup. This will run all the kernels in the ScriptGroup. No internal connection results will be visible after execution of the ScriptGroup.
public Object[] execute (Object... inputs)
Executes a script group
| Parameters | |
|---|---|
| inputs | Object: Values for inputs to the script group, in the order as the
        inputs are added viaBuilder2#addInput. | 
| Returns | |
|---|---|
| Object[] | Outputs of the script group as an array of objects, in the order
         as futures are passed to Builder2#create. | 
public void setInput (Script.KernelID s, Allocation a)
      This method is deprecated.
    Set arguments to execute(java.lang.Object) instead.
  
Sets an input of the ScriptGroup. This specifies an Allocation to be used for kernels that require an input Allocation provided from outside of the ScriptGroup.
| Parameters | |
|---|---|
| s | Script.KernelID: The ID of the kernel where the allocation should be
          connected. | 
| a | Allocation: The allocation to connect. | 
public void setOutput (Script.KernelID s, Allocation a)
      This method is deprecated.
    Use return value of execute(java.lang.Object) instead.
  
Sets an output of the ScriptGroup. This specifies an Allocation to be used for the kernels that require an output Allocation visible after the ScriptGroup is executed.
| Parameters | |
|---|---|
| s | Script.KernelID: The ID of the kernel where the allocation should be
          connected. | 
| a | Allocation: The allocation to connect. |