# GPU

Artifact: [androidx.webgpu:webgpu](https://developer.android.com/jetpack/androidx/releases/webgpu) [View Source](https://cs.android.com/search?q=file:androidx/webgpu/Functions.kt+class:androidx.webgpu.GPU) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

*** ** * ** ***


```
object GPU
```

<br />

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstance` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPU#createInstance(androidx.webgpu.GPUInstanceDescriptor)(descriptor: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceDescriptor?)` Creates a new WebGPU instance. |
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSupportedInstanceFeatures` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPU#getInstanceFeatures(androidx.webgpu.GPUSupportedInstanceFeatures)(features: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSupportedInstanceFeatures)` Retrieves the list of features supported by the instance. |
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceLimits` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPU#getInstanceLimits(androidx.webgpu.GPUInstanceLimits)(limits: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceLimits)` Retrieves the limits supported by the instance. |
| `external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPU#hasInstanceFeature(kotlin.Int)(feature: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Checks if a specific feature is supported by the instance. |

## Public functions

### createInstance

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
@FastNative
external fun createInstance(descriptor: GPUInstanceDescriptor? = null): GPUInstance
```

Creates a new WebGPU instance.

| Parameters |
|---|---|
| `descriptor: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceDescriptor? = null` | The descriptor for the instance. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstance` | A handle to the created instance. |

### getInstanceFeatures

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
@FastNative
external fun getInstanceFeatures(features: GPUSupportedInstanceFeatures): GPUSupportedInstanceFeatures
```

Retrieves the list of features supported by the instance.

| Parameters |
|---|---|
| `features: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSupportedInstanceFeatures` | A structure to be filled with the supported features. |

### getInstanceLimits

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
@FastNative
external fun getInstanceLimits(limits: GPUInstanceLimits = GPUInstanceLimits()): GPUInstanceLimits
```

Retrieves the limits supported by the instance.

| Parameters |
|---|---|
| `limits: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceLimits = GPUInstanceLimits()` | A structure to be filled with the supported limits. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUInstanceLimits` | The status of the operation. |

### hasInstanceFeature

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
@FastNative
external fun hasInstanceFeature(feature: Int): Boolean
```

Checks if a specific feature is supported by the instance.

| Parameters |
|---|---|
| `feature: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The feature to check for. Value is one of the following: - `1` - `2` - `3` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | {@code true} if the feature is supported, {@code false} otherwise. |