File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -655,6 +655,17 @@ <h2>Comparison Charts</h2>
655655 // Load into Flare engine
656656 flareEngine = flareLib . FlareEngine . load ( bytes ) ;
657657
658+ // Try WebGPU acceleration
659+ try {
660+ const gpuOk = await flareEngine . init_gpu ( ) ;
661+ const info = JSON . parse ( flareEngine . backend_info ( ) ) ;
662+ console . log ( '[Flare] backend_info:' , info ) ;
663+ log ( `Flare backend: ${ JSON . stringify ( info ) } ` , gpuOk ? 'success' : 'info' ) ;
664+ } catch ( e ) {
665+ console . warn ( '[Flare] GPU init failed:' , e ) ;
666+ log ( 'Flare GPU init failed — using CPU SIMD' , 'info' ) ;
667+ }
668+
658669 const loadTime = performance . now ( ) - t0 ;
659670 log ( `Flare model loaded in ${ ( loadTime / 1000 ) . toFixed ( 1 ) } s (arch: ${ flareEngine . architecture } )` , 'success' ) ;
660671 return loadTime ;
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ interface FlareEngineInstance {
5959 reset ( ) : void ;
6060 add_stop_sequence ( seq : string ) : void ;
6161 clear_stop_sequences ( ) : void ;
62+ backend_info ( ) : string ;
6263}
6364
6465interface FlareModule {
@@ -310,6 +311,7 @@ export class FlareEngineWrapper {
310311 if ( useGpu ) {
311312 try {
312313 this . gpuEnabled = await this . engine . init_gpu ( ) ;
314+ console . log ( '[Flare]' , JSON . parse ( this . engine . backend_info ( ) ) ) ;
313315 if ( ! this . gpuEnabled ) {
314316 console . info ( '[Flare] WebGPU unavailable — using CPU SIMD path' ) ;
315317 }
You can’t perform that action at this time.
0 commit comments