@@ -13,7 +13,6 @@ import { ProgramManager } from './webgpu/program-manager';
1313import {
1414 AdapterInfo ,
1515 ComputeContext ,
16- DeviceInfo ,
1716 GpuArchitecture ,
1817 GpuData ,
1918 GpuVendor ,
@@ -135,34 +134,13 @@ class AdapterInfoImpl implements AdapterInfo {
135134 }
136135}
137136
138- class DeviceInfoImpl implements DeviceInfo {
139- readonly subgroupsSupported : boolean ;
140- readonly subgroupsF16Supported : boolean ;
141- readonly subgroupSizeRange ?: readonly [ number , number ] ;
142-
143- constructor ( device : GPUDevice ) {
144- this . subgroupsSupported = device . features . has ( 'subgroups' as GPUFeatureName ) ;
145- this . subgroupsF16Supported = device . features . has ( 'subgroups' as GPUFeatureName ) ;
146- // Currently subgroups feature is still experimental and size attributes are not in the WebGPU IDL, so we have to
147- // workaround the IDL type checks.
148- // TODO: clean this after subgroups feature is settled in IDL.
149- const deviceSubgroupsLimits = device . limits as { minSubgroupSize ?: number ; maxSubgroupSize ?: number } ;
150- if ( ! this . subgroupsSupported || ! deviceSubgroupsLimits . minSubgroupSize || ! deviceSubgroupsLimits . maxSubgroupSize ) {
151- this . subgroupSizeRange = undefined ;
152- } else {
153- this . subgroupSizeRange = [ deviceSubgroupsLimits . minSubgroupSize , deviceSubgroupsLimits . maxSubgroupSize ] ;
154- }
155- }
156- }
157-
158137/**
159138 * this class is designed to store status and being used as a singleton for JSEP. It will be passed to jsepInit() as
160139 * the first parameter so that it is stored for future use.
161140 */
162141export class WebGpuBackend {
163142 adapterInfo : AdapterInfoImpl ;
164143 device : GPUDevice ;
165- deviceInfo : DeviceInfoImpl ;
166144 /**
167145 * an instance of GpuDataManager to manage a GpuDataId -> GpuBuffer mapping
168146 */
@@ -274,13 +252,9 @@ export class WebGpuBackend {
274252 }
275253 requireFeatureIfAvailable ( 'shader-f16' ) ;
276254 // Try subgroups
277- if ( requireFeatureIfAvailable ( 'subgroups' as GPUFeatureName ) ) {
278- // If subgroups feature is available, also try subgroups-f16
279- requireFeatureIfAvailable ( 'subgroups-f16' as GPUFeatureName ) ;
280- }
255+ requireFeatureIfAvailable ( 'subgroups' as GPUFeatureName ) ;
281256
282257 this . device = await adapter . requestDevice ( deviceDescriptor ) ;
283- this . deviceInfo = new DeviceInfoImpl ( this . device ) ;
284258 this . adapterInfo = new AdapterInfoImpl ( adapter . info || ( await adapter . requestAdapterInfo ( ) ) ) ;
285259 this . gpuDataManager = createGpuDataManager ( this ) ;
286260 this . programManager = new ProgramManager ( this ) ;
0 commit comments