From 44d338495caa6024f602365b0fd7a7160ab8eaec Mon Sep 17 00:00:00 2001 From: cryscan Date: Sun, 12 May 2024 22:46:31 +0800 Subject: [PATCH] Make WASM work. --- Cargo.toml | 2 +- src/context.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b721b22..a1f7f93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["deep-learning", "language", "model", "rwkv"] license = "MIT OR Apache-2.0" name = "web-rwkv" repository = "https://github.com/cryscan/web-rwkv" -version = "0.8.8" +version = "0.8.9" [dependencies] ahash = "0.8" diff --git a/src/context.rs b/src/context.rs index 8a8a67d..3033b91 100644 --- a/src/context.rs +++ b/src/context.rs @@ -8,8 +8,8 @@ use wgpu::{ util::{BufferInitDescriptor, DeviceExt}, Adapter, BindGroupLayout, BindGroupLayoutDescriptor, BindGroupLayoutEntry, Buffer, BufferDescriptor, BufferUsages, ComputePipeline, ComputePipelineDescriptor, Device, - DeviceDescriptor, Features, Instance, Limits, Maintain, PipelineLayoutDescriptor, - PowerPreference, Queue, RequestAdapterOptions, ShaderModuleDescriptor, + DeviceDescriptor, Features, Instance, Limits, PipelineLayoutDescriptor, PowerPreference, Queue, + RequestAdapterOptions, ShaderModuleDescriptor, }; use crate::tensor::{ @@ -22,7 +22,7 @@ pub trait InstanceExt { fn adapter( &self, power_preference: PowerPreference, - ) -> impl Future> + Send; + ) -> impl Future>; } impl InstanceExt for Instance { @@ -71,7 +71,7 @@ impl Drop for Context { fn drop(&mut self) { if Arc::strong_count(&self.0) <= 1 { self.queue.submit(None); - self.device.poll(Maintain::Wait); + self.device.poll(wgpu::Maintain::Wait); } } }