Skip to content

Commit ad4dce8

Browse files
committed
fix clippy & docs
1 parent ce39357 commit ad4dce8

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ supported platforms.
1313
### Using Slang
1414

1515
In order to compile and run any slang project, be sure to define the `SLANG_DIR` environment variable:
16-
1. Download the Slang compiler libraries for your platform: https://github.com/shader-slang/slang/releases/tag/v2025.16
16+
1. Download the Slang compiler libraries for your platform: <https://github.com/shader-slang/slang/releases/tag/v2025.16>
1717
2. Unzip the downloaded directory, and use its path as value to the `SLANG_DIR` environment variable: `SLANG_DIR=/path/to/slang`.
1818
Note that the variable must point to the root of the slang installation (i.e. the directory that contains `bin` and `lib`).
1919
We recommend adding that as a system-wide environment variables so that it also becomes available to your IDE.

examples/gemm_bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use approx::assert_relative_eq;
21
use indexmap::IndexMap;
32
use minislang::SlangCompiler;
43
use nalgebra::DMatrix;
@@ -105,7 +104,7 @@ async fn run_gemm<B: Backend>(
105104
drop(pass); // Ensure the pass is ended before the encoder is borrowed again.
106105

107106
backend.submit(encoder)?;
108-
backend.synchronize();
107+
backend.synchronize()?;
109108
timing[i] = t0.elapsed().as_secs_f32();
110109
backend
111110
.slow_read_buffer(result.buffer(), gpu_result.as_mut_slice())

src/linalg/contiguous.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ mod test {
8585
}
8686

8787
async fn gpu_contiguous_generic(backend: impl Backend) {
88-
let compiler = SlangCompiler::new(vec!["../../crates/stensor/shaders".into()]);
88+
let mut compiler = SlangCompiler::new(vec![]);
89+
crate::register_shaders(&mut compiler);
8990
let contiguous = super::Contiguous::from_backend(&backend, &compiler).unwrap();
9091

9192
let mut shapes = ViewShapeBuffers::new(&backend);

src/linalg/gemm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ mod test {
237237
}
238238

239239
async fn gpu_gemm_generic(backend: impl Backend) {
240-
let compiler = SlangCompiler::new(vec!["../../crates/stensor/shaders".into()]);
240+
let mut compiler = SlangCompiler::new(vec![]);
241+
crate::register_shaders(&mut compiler);
241242
let gemm = super::Gemm::from_backend(&backend, &compiler).unwrap();
242243

243244
let mut shapes = ViewShapeBuffers::new(&backend);

src/linalg/gemv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ mod test {
349349
}
350350

351351
async fn gpu_gemv_generic(backend: impl Backend) {
352-
let compiler = SlangCompiler::new(vec!["../../crates/stensor/shaders".into()]);
352+
let mut compiler = SlangCompiler::new(vec![]);
353+
crate::register_shaders(&mut compiler);
353354
let gemv = super::Gemv::from_backend(&backend, &compiler).unwrap();
354355

355356
let mut shapes = ViewShapeBuffers::new(&backend);

src/linalg/op_assign.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ mod test {
187187
OpAssignVariant::Div,
188188
OpAssignVariant::Copy,
189189
];
190-
let compiler = SlangCompiler::new(vec!["../../crates/stensor/shaders".into()]);
190+
let mut compiler = SlangCompiler::new(vec![]);
191+
crate::register_shaders(&mut compiler);
191192

192193
let op_assign = super::OpAssign::from_backend(&backend, &compiler).unwrap();
193194

src/linalg/reduce.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ mod test {
9393
ReduceVariant::Prod,
9494
ReduceVariant::SqNorm,
9595
];
96-
let compiler = SlangCompiler::new(vec!["../../crates/stensor/shaders".into()]);
96+
let mut compiler = SlangCompiler::new(vec![]);
97+
crate::register_shaders(&mut compiler);
9798

9899
let reduce = super::Reduce::from_backend(&backend, &compiler).unwrap();
99100

src/tensor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ impl<T: DeviceValue, B: Backend> GpuTensor<T, B> {
10401040

10411041
/// Allocates a new vector on the gpu initialized from `vector`.
10421042
///
1043-
/// If `T` does not implement `NoUninit`, use [`GpuMatrix::encase`] instead.
1043+
/// If `T` does not implement `NoUninit`, use [`GpuTensor::vector_encased`] instead.
10441044
pub fn vector(
10451045
backend: &B,
10461046
vector: impl AsRef<[T]>,
@@ -1069,8 +1069,6 @@ impl<T: DeviceValue, B: Backend> GpuTensor<T, B> {
10691069
}
10701070

10711071
/// Allocates a new vector on the gpu initialized from `vector`.
1072-
///
1073-
/// If `T` does not implement `NoUninit`, use [`GpuMatrix::encase`] instead.
10741072
pub fn vector_encased(
10751073
backend: &B,
10761074
vector: impl AsRef<[T]>,

0 commit comments

Comments
 (0)