diff --git a/README.md b/README.md index 69f2ad80..7d8e46ab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # Ratchet +

+ [Discord](https://discord.gg/XFe33KQTG4) +

+ A web-first, cross-platform ML framework. diff --git a/crates/ratchet-core/src/gpu/pools/dynamic_resource_pool.rs b/crates/ratchet-core/src/gpu/pools/dynamic_resource_pool.rs index 71166955..1ab846bd 100644 --- a/crates/ratchet-core/src/gpu/pools/dynamic_resource_pool.rs +++ b/crates/ratchet-core/src/gpu/pools/dynamic_resource_pool.rs @@ -1,5 +1,5 @@ // All resource management taken from [Rerun](https://github.com/rerun-io/rerun) MIT. -use super::{PoolError, ResourceConstructor, ResourceDestructor}; +use super::PoolError; use crate::RVec; use std::{ collections::hash_map::Entry, @@ -82,7 +82,7 @@ where Handle: Key, Desc: Clone + Eq + Hash + Debug + DynamicResourcesDesc, { - pub fn get_or_create>( + pub fn get_or_create Res>( &self, desc: &Desc, constructor: F, @@ -141,7 +141,7 @@ where pub fn begin_pass(&mut self, pass_index: u64, mut destructor: D) where - D: ResourceDestructor, + D: FnMut(&Res), { self.current_pass_index = pass_index; let state = self.state.get_mut(); diff --git a/crates/ratchet-core/src/gpu/pools/static_resource_pool.rs b/crates/ratchet-core/src/gpu/pools/static_resource_pool.rs index 776c7f79..13002f67 100644 --- a/crates/ratchet-core/src/gpu/pools/static_resource_pool.rs +++ b/crates/ratchet-core/src/gpu/pools/static_resource_pool.rs @@ -17,9 +17,6 @@ pub enum PoolError { UnknownDescriptor, } -pub trait ResourceConstructor = Fn(&Descriptor) -> Resource; -pub trait ResourceDestructor = FnMut(&Resource); - /// Generic resource pool for all resources that are fully described upon creation, i.e. never have any variable content. /// /// This implies, a resource is uniquely defined by its description. @@ -56,7 +53,7 @@ where }) } - pub fn get_or_create>( + pub fn get_or_create Resource>( &self, descriptor: &Descriptor, constructor: C, diff --git a/crates/ratchet-core/src/kernels.rs b/crates/ratchet-core/src/kernels.rs index 50aee585..92408394 100644 --- a/crates/ratchet-core/src/kernels.rs +++ b/crates/ratchet-core/src/kernels.rs @@ -1,12 +1,27 @@ // This file is generated by build.rs. Do not edit it manually. -use std::collections::HashMap; use lazy_static::lazy_static; +use std::collections::HashMap; lazy_static! { -pub static ref KERNELS: HashMap<&'static str, &'static str> = { - let mut m = HashMap::new(); - m.insert("qgemm_vec4", include_str!("/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/qgemm_vec4.wgsl")); - m.insert("sgemm_scalar", include_str!("/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/sgemm_scalar.wgsl")); - m.insert("add_scalar", include_str!("/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/add_scalar.wgsl")); - m -}; + pub static ref KERNELS: HashMap<&'static str, &'static str> = { + let mut m = HashMap::new(); + m.insert( + "qgemm_vec4", + include_str!( + "/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/qgemm_vec4.wgsl" + ), + ); + m.insert( + "sgemm_scalar", + include_str!( + "/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/sgemm_scalar.wgsl" + ), + ); + m.insert( + "add_scalar", + include_str!( + "/Users/fleetwood/Code/ratchet/crates/ratchet-core/kernels/add_scalar.wgsl" + ), + ); + m + }; } diff --git a/crates/ratchet-core/src/lib.rs b/crates/ratchet-core/src/lib.rs index 1f5fe03b..6eecbfde 100644 --- a/crates/ratchet-core/src/lib.rs +++ b/crates/ratchet-core/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(trait_alias)] #![allow(non_snake_case)] mod compiled_op; mod device;