> Documentation index: https://developer.android.com/reference/llms.txt

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/renderscript/Script.md.txt#nestedclasses) \| [Methods](https://developer.android.com/reference/android/renderscript/Script.md.txt#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/renderscript/Script.md.txt#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/renderscript/Script.md.txt#inhmethods)

# Script

*** ** * ** ***


`
public


class
Script
`


`


`

`

extends BaseObj


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.md.txt) |||
| ↳ | [android.renderscript.BaseObj](https://developer.android.com/reference/android/renderscript/BaseObj.md.txt) ||
|   | ↳ | android.renderscript.Script |

Known direct subclasses [ScriptC](https://developer.android.com/reference/android/renderscript/ScriptC.md.txt), [ScriptIntrinsic](https://developer.android.com/reference/android/renderscript/ScriptIntrinsic.md.txt) [ScriptC](https://developer.android.com/reference/android/renderscript/ScriptC.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsic](https://developer.android.com/reference/android/renderscript/ScriptIntrinsic.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* Known indirect subclasses [ScriptIntrinsic3DLUT](https://developer.android.com/reference/android/renderscript/ScriptIntrinsic3DLUT.md.txt), [ScriptIntrinsicBLAS](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBLAS.md.txt), [ScriptIntrinsicBlend](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlend.md.txt), [ScriptIntrinsicBlur](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur.md.txt), [ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix.md.txt), [ScriptIntrinsicConvolve3x3](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicConvolve3x3.md.txt), [ScriptIntrinsicConvolve5x5](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicConvolve5x5.md.txt), [ScriptIntrinsicHistogram](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram.md.txt), [ScriptIntrinsicLUT](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicLUT.md.txt), [ScriptIntrinsicResize](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicResize.md.txt), [ScriptIntrinsicYuvToRGB](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicYuvToRGB.md.txt) [ScriptIntrinsic3DLUT](https://developer.android.com/reference/android/renderscript/ScriptIntrinsic3DLUT.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicBLAS](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBLAS.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicBlend](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlend.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicBlur](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicConvolve3x3](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicConvolve3x3.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicConvolve5x5](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicConvolve5x5.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicHistogram](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicLUT](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicLUT.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicResize](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicResize.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.* [ScriptIntrinsicYuvToRGB](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicYuvToRGB.md.txt) *This class was deprecated
in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.*   

*** ** * ** ***


**This class was deprecated
in API level 31.**   

Renderscript has been deprecated in API level 31. Please refer to the [migration
guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.

The parent class for all executable scripts. This should not be used by
applications.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `Script.Builder` Only intended for use by generated reflected code. |
| ` class` | `Script.FieldBase` Only intended for use by generated reflected code. |
| ` class` | `Script.FieldID` FieldID is an identifier for a Script + exported field pair. |
| ` class` | `Script.InvokeID` InvokeID is an identifier for an invoke function. |
| ` class` | `Script.KernelID` KernelID is an identifier for a Script + root function pair. |
| ` class` | `Script.LaunchOptions` Class for specifying the specifics about how a kernel will be launched. |

| ### Public methods ||
|---|---|
| ` void` | ` bindAllocation(Allocation va, int slot) ` Only intended for use by generated reflected code. |
| ` boolean` | ` getVarB(int index) ` |
| ` double` | ` getVarD(int index) ` |
| ` float` | ` getVarF(int index) ` |
| ` int` | ` getVarI(int index) ` |
| ` long` | ` getVarJ(int index) ` |
| ` void` | ` getVarV(int index, FieldPacker v) ` Only intended for use by generated reflected code. |
| ` void` | ` setTimeZone(String timeZone) ` |
| ` void` | ` setVar(int index, boolean v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, int v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, FieldPacker v, Element e, int[] dims) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, FieldPacker v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, float v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, double v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, long v) ` Only intended for use by generated reflected code. |
| ` void` | ` setVar(int index, BaseObj o) ` Only intended for use by generated reflected code. |

| ### Protected methods ||
|---|---|
| ` Script.FieldID` | ` createFieldID(int slot, Element e) ` Only to be used by generated reflected classes. |
| ` Script.InvokeID` | ` createInvokeID(int slot) ` Only to be used by generated reflected classes. |
| ` Script.KernelID` | ` createKernelID(int slot, int sig, Element ein, Element eout) ` Only to be used by generated reflected classes. |
| ` void` | ` forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v) ` Only intended for use by generated reflected code. |
| ` void` | ` forEach(int slot, Allocation ain, Allocation aout, FieldPacker v, Script.LaunchOptions sc) ` Only intended for use by generated reflected code. |
| ` void` | ` forEach(int slot, Allocation ain, Allocation aout, FieldPacker v) ` Only intended for use by generated reflected code. |
| ` void` | ` forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v, Script.LaunchOptions sc) ` Only intended for use by generated reflected code. |
| ` void` | ` invoke(int slot) ` Only intended for use by generated reflected code. |
| ` void` | ` invoke(int slot, FieldPacker v) ` Only intended for use by generated reflected code. |
| ` void` | ` reduce(int slot, Allocation[] ains, Allocation aout, Script.LaunchOptions sc) ` Only intended for use by generated reflected code. |

### Inherited methods

From class `

android.renderscript.BaseObj

` `


void` `
destroy()
`

Frees any native resources associated with this object.


`


boolean` `
equals(Object obj)
`

Compare the current BaseObj with another BaseObj for equality.


`


void` `
finalize()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


String` `
getName()
` `


int` `
hashCode()
`

Calculates the hash code value for a BaseObj.


`


void` `
setName(String name)
`

setName assigns a name to an object.


From class `

java.lang.Object

` `


Object` `
clone()
`

Creates and returns a copy of this object.


`


boolean` `
equals(Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
finalize()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

Class<?>` `
getClass()
`

Returns the runtime class of this `Object`.


`


int` `
hashCode()
`

Returns a hash code value for the object.


`


final

void` `
notify()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
notifyAll()
`

Wakes up all threads that are waiting on this object's monitor.


`


String` `
toString()
`

Returns a string representation of the object.


`


final

void` `
wait(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
wait(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
wait()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public methods

### bindAllocation

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void bindAllocation (Allocation va, 
                int slot)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `va` | `Allocation` <br /> |
| `slot` | `int` <br /> |

### getVarB

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getVarB (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `boolean` | <br /> |

### getVarD

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public double getVarD (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `double` | <br /> |

### getVarF

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getVarF (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `float` | <br /> |

### getVarI

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getVarI (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `int` | <br /> |

### getVarJ

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getVarJ (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `long` | <br /> |

### getVarV

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void getVarV (int index, 
                FieldPacker v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `FieldPacker` <br /> |

### setTimeZone

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setTimeZone (String timeZone)
```

<br />

<br />

| Parameters ||
|---|---|
| `timeZone` | `String` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                boolean v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `boolean` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                int v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `int` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                FieldPacker v, 
                Element e, 
                int[] dims)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `FieldPacker` <br /> |
| `e` | `Element` <br /> |
| `dims` | `int` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                FieldPacker v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `FieldPacker` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                float v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `float` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                double v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `double` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                long v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `v` | `long` <br /> |

### setVar

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setVar (int index, 
                BaseObj o)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |
| `o` | `BaseObj` <br /> |

## Protected methods

### createFieldID

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected Script.FieldID createFieldID (int slot, 
                Element e)
```

Only to be used by generated reflected classes.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `e` | `Element` <br /> |

| Returns ||
|---|---|
| `Script.FieldID` | <br /> |

### createInvokeID

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected Script.InvokeID createInvokeID (int slot)
```

Only to be used by generated reflected classes.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |

| Returns ||
|---|---|
| `Script.InvokeID` | <br /> |

### createKernelID

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected Script.KernelID createKernelID (int slot, 
                int sig, 
                Element ein, 
                Element eout)
```

Only to be used by generated reflected classes.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `sig` | `int` <br /> |
| `ein` | `Element` <br /> |
| `eout` | `Element` <br /> |

| Returns ||
|---|---|
| `Script.KernelID` | <br /> |

### forEach

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void forEach (int slot, 
                Allocation[] ains, 
                Allocation aout, 
                FieldPacker v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `ains` | `Allocation` <br /> |
| `aout` | `Allocation` <br /> |
| `v` | `FieldPacker` <br /> |

### forEach

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void forEach (int slot, 
                Allocation ain, 
                Allocation aout, 
                FieldPacker v, 
                Script.LaunchOptions sc)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `ain` | `Allocation` <br /> |
| `aout` | `Allocation` <br /> |
| `v` | `FieldPacker` <br /> |
| `sc` | `Script.LaunchOptions` <br /> |

### forEach

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void forEach (int slot, 
                Allocation ain, 
                Allocation aout, 
                FieldPacker v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `ain` | `Allocation` <br /> |
| `aout` | `Allocation` <br /> |
| `v` | `FieldPacker` <br /> |

### forEach

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void forEach (int slot, 
                Allocation[] ains, 
                Allocation aout, 
                FieldPacker v, 
                Script.LaunchOptions sc)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `ains` | `Allocation` <br /> |
| `aout` | `Allocation` <br /> |
| `v` | `FieldPacker` <br /> |
| `sc` | `Script.LaunchOptions` <br /> |

### invoke

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void invoke (int slot)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |

### invoke

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void invoke (int slot, 
                FieldPacker v)
```

Only intended for use by generated reflected code.

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `v` | `FieldPacker` <br /> |

### reduce

<br />

Deprecated in [API level
31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void reduce (int slot, 
                Allocation[] ains, 
                Allocation aout, 
                Script.LaunchOptions sc)
```

Only intended for use by generated reflected code. (General reduction)

<br />

| Parameters ||
|---|---|
| `slot` | `int` <br /> |
| `ains` | `Allocation` <br /> |
| `aout` | `Allocation` <br /> |
| `sc` | `Script.LaunchOptions` <br /> |