# 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)

*** ** * ** ***


```
public final class GPUAdapter implements AutoCloseable
```

<br />

*** ** * ** ***

Represents a physical graphics adapter.

## Summary

| ### Public methods |
|---|---|
| `external void` | `https://developer.android.com/reference/androidx/webgpu/GPUAdapter#close()()` Decrements the reference count of the object and frees resources when the count reaches zero. |
| `boolean` | `https://developer.android.com/reference/androidx/webgpu/GPUAdapter#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final external @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUSupportedFeatures` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/androidx/webgpu/GPUAdapter#getFeatures()()` Retrieves the list of features supported by the adapter. |
| `final long` | `https://developer.android.com/reference/androidx/webgpu/GPUAdapter#getHandle()()` |
| `final external @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUAdapterInfo` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/androidx/webgpu/GPUAdapter#getInfo()()` Retrieves detailed information about the adapter. |
| `final external @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPULimits` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/androidx/webgpu/GPUAdapter#getLimits()()` Retrieves the limits supported by the adapter. |
| `final external boolean` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/androidx/webgpu/GPUAdapter#hasFeature(kotlin.Int)(int feature)` Checks if a specific feature is supported by the adapter. |
| `int` | `https://developer.android.com/reference/androidx/webgpu/GPUAdapter#hashCode()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice` | `https://developer.android.com/reference/androidx/webgpu/GPUAdapter#requestDevice(androidx.webgpu.GPUDeviceDescriptor)(https://developer.android.com/reference/androidx/webgpu/GPUDeviceDescriptor descriptor)` Asynchronously requests a device from the adapter. |
| `final external void` | `@https://developer.android.com/reference/dalvik/annotation/optimization/FastNative.html https://developer.android.com/reference/androidx/webgpu/GPUAdapter#requestDevice(java.util.concurrent.Executor,androidx.webgpu.GPUDeviceDescriptor,androidx.webgpu.GPURequestCallback)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html callbackExecutor, https://developer.android.com/reference/androidx/webgpu/GPUDeviceDescriptor descriptor, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPURequestCallback<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/webgpu/GPUDevice> callback )` Asynchronously requests a device from the adapter. |

## Public methods

### close

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

```
public external void close()
```

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

```
public boolean equals(Object other)
```

### getFeatures

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

```
@FastNative
public final external @NonNull GPUSupportedFeatures getFeatures()
```

Retrieves the list of features supported by the adapter.

### getHandle

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

```
public final long getHandle()
```

### getInfo

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

```
@FastNative
public final external @NonNull GPUAdapterInfo getInfo()
```

Retrieves detailed information about the adapter.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/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
public final external @NonNull GPULimits getLimits()
```

Retrieves the limits supported by the adapter.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/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
public final external boolean hasFeature(int feature)
```

Checks if a specific feature is supported by the adapter.

| Parameters |
|---|---|
| `int feature` | 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 |
|---|---|
| `boolean` | {@code true} if the feature is supported, {@code false} otherwise. |

### hashCode

```
public int hashCode()
```

### requestDevice

```
public final @NonNull GPUDevice requestDevice(GPUDeviceDescriptor descriptor)
```

Asynchronously requests a device from the adapter.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/webgpu/GPUDeviceDescriptor descriptor` | 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
public final external void requestDevice(
    @NonNull Executor callbackExecutor,
    GPUDeviceDescriptor descriptor,
    @NonNull GPURequestCallback<@NonNull GPUDevice> callback
)
```

Asynchronously requests a device from the adapter.