teeny_cuda/runtime/mod.rs
1/*
2 * Copyright (c) 2026 Teenygrad.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17use teeny_core::runtime::Runtime;
18
19use crate::{
20 device::CudaDevice,
21 model::{CudaModel, TensorRef},
22};
23
24/// The CUDA [`Runtime`] implementation: executes a [`CudaModel`] on a [`CudaDevice`].
25pub struct CudaRuntime<'a> {
26 /// The device this runtime executes on.
27 pub device: CudaDevice<'a>,
28}
29
30impl<'a> Runtime<'a> for CudaRuntime<'a> {
31 type Model = CudaModel<'a>;
32 type Input = TensorRef;
33 type Output = TensorRef;
34
35 fn forward<D: teeny_core::dtype::Dtype, const RANK: usize>(
36 &self,
37 _model: &Self::Model,
38 _input: &Self::Input,
39 ) -> teeny_core::errors::Result<Self::Output> {
40 todo!()
41 }
42}