pub struct RewriteOptions {
pub host_module: String,
pub host_fn: String,
pub host_alloc_fn: String,
pub host_free_fn: String,
pub sm_version: u32,
pub tenant_id: TenantId,
pub detector: DetectorConfig,
}Expand description
Options controlling the rewrite.
Fields§
§host_module: StringHost import module (defaults to tensor-wasm:jit/host).
host_fn: StringHost import function name for dispatch (defaults to dispatch).
host_alloc_fn: StringHost import function name for the scratch allocator (defaults to alloc).
host_free_fn: StringHost import function name for the scratch deallocator (defaults to free).
sm_version: u32CUDA compute capability the pre-populated kernels are compiled for.
tenant_id: TenantIdOwning tenant the rewrite-time cache pre-population is keyed under.
The rewriter pre-populates the KernelCache with the emitted PTX
for every offloaded function so the first runtime dispatch hits
straight away instead of missing and re-emitting. That hit only
lands if the pre-populated entry’s CacheKey tenant matches the
tenant the runtime dispatch looks up under — cache keys are
tenant-scoped (see CacheKey for the cross-tenant confused-deputy
primitive this enforces). Thread the owning tenant in here so the
pre-populated entries are reachable at runtime.
Defaults to TenantId(0) for backward compatibility: callers that
do not yet know the owning tenant get the historical behaviour
(entries land under the TenantId(0) placeholder and the runtime
misses + re-emits on first call).
detector: DetectorConfigDetector configuration used to classify each function body. Use this to lower thresholds in tests or to tune offload aggressiveness in production deployments.
Trait Implementations§
Source§impl Clone for RewriteOptions
impl Clone for RewriteOptions
Source§fn clone(&self) -> RewriteOptions
fn clone(&self) -> RewriteOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RewriteOptions
impl Debug for RewriteOptions
Auto Trait Implementations§
impl Freeze for RewriteOptions
impl RefUnwindSafe for RewriteOptions
impl Send for RewriteOptions
impl Sync for RewriteOptions
impl Unpin for RewriteOptions
impl UnsafeUnpin for RewriteOptions
impl UnwindSafe for RewriteOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more