# GPUAdapter

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

*** ** * ** ***


```
class GPUAdapter : AutoCloseable
```

<br />

*** ** * ** ***

Represents a physical graphics adapter.

## Summary

| ### Public functions |
|---|---|
| `open external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#close()()` Decrements the reference count of the object and frees resources when the count reaches zero. |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPUSupportedFeatures` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#getFeatures()()` Retrieves the list of features supported by the adapter. |
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapterInfo` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#getInfo()()` Retrieves detailed information about the adapter. |
| `external https://developer.android.com/reference/kotlin/androidx/webgpu/GPULimits` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#getLimits()()` Retrieves the limits supported by the adapter. |
| `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/GPUAdapter#hasFeature(kotlin.Int)(feature: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Checks if a specific feature is supported by the adapter. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#hashCode()()` |
| `suspend https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDevice` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#requestDevice(androidx.webgpu.GPUDeviceDescriptor)(descriptor: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDeviceDescriptor?)` Asynchronously requests a device from the adapter. |
| `external https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#requestDevice(java.util.concurrent.Executor,androidx.webgpu.GPUDeviceDescriptor,androidx.webgpu.GPURequestCallback)( callbackExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html, descriptor: https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDeviceDescriptor?, callback: https://developer.android.com/reference/kotlin/androidx/webgpu/GPURequestCallback<https://developer.android.com/reference/kotlin/androidx/webgpu/GPUDevice> )` Asynchronously requests a device from the adapter. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/GPUAdapter#handle()` |

## Public functions

### close

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

```
open external fun close(): Unit
```

Decrements the reference count of the object and frees resources when the count reaches zero.

This is the standard way to manage object lifetimes and should be used in `use` blocks. After calling this, the object is no longer usable.

### equals

```
open operator fun equals(other: Any?): Boolean
```

### getFeatures

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

```
@FastNative
external fun getFeatures(): GPUSupportedFeatures
```

Retrieves the list of features supported by the adapter.

### getInfo

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

```
@FastNative
external fun getInfo(): GPUAdapterInfo
```

Retrieves detailed information about the adapter.

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

### getLimits

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

```
@FastNative
external fun getLimits(): GPULimits
```

Retrieves the limits supported by the adapter.

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

### hasFeature

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

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

Checks if a specific feature is supported by the adapter.

| 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` - `4` - `5` - `6` - `7` - `8` - `9` - `10` - `11` - `12` - `13` - `14` - `15` - `16` - `17` - `18` - `19` - `20` - `21` - `22` - `23` - `327710` - `327719` - `327725` - `327741` <br /> |

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

### hashCode

```
open fun hashCode(): Int
```

### requestDevice

```
suspend fun requestDevice(descriptor: GPUDeviceDescriptor? = null): GPUDevice
```

Asynchronously requests a device from the adapter.

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

### requestDevice

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

```
@FastNative
external fun requestDevice(
    callbackExecutor: Executor,
    descriptor: GPUDeviceDescriptor? = null,
    callback: GPURequestCallback<GPUDevice>
): Unit
```

Asynchronously requests a device from the adapter.

## Public properties

### handle

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

```
val handle: Long
```