3个版本 (破坏性)

0.3.0 2022年4月17日
0.2.0 2021年10月28日
0.1.0 2021年9月28日

#4 in #memcpy

Download history 177/week @ 2024-04-14 162/week @ 2024-04-21 166/week @ 2024-04-28 181/week @ 2024-05-05 118/week @ 2024-05-12 315/week @ 2024-05-19 148/week @ 2024-05-26 174/week @ 2024-06-02 126/week @ 2024-06-09 167/week @ 2024-06-16 137/week @ 2024-06-23 63/week @ 2024-06-30 86/week @ 2024-07-07 131/week @ 2024-07-14 135/week @ 2024-07-21 176/week @ 2024-07-28

每月533次下载
5 个crate中使用 (3 直接)

MIT/Apache

15KB
329

ndcopy

快速N维数组memcpy。

通过逐行复制切片来提高速度。Rust在复制切片方面比尝试为每个值索引N维坐标要快得多。

示例代码

use ndcopy::ndshape::{ConstShape, ConstShape3u32};
use ndcopy::copy3;

type SrcShape = ConstShape3u32<50, 50, 50>;
type DstShape = ConstShape3u32<25, 25, 25>;
let src = [1u8; SrcShape::USIZE];
let mut dst = [0u8; DstShape::USIZE];

let copy_shape = [20; 3];
let src_min = [1, 2, 3];
let dst_min = [2, 3, 4];
copy3(
    copy_shape,
    &src,
    &SrcShape {},
    src_min,
    &mut dst,
    &DstShape {},
    dst_min,
);

许可证:MIT OR Apache-2.0


lib.rs:

快速N维数组memcpy。

通过逐行复制切片来提高速度。Rust在复制切片方面比尝试为每个值索引N维坐标要快得多。

示例代码

use ndcopy::ndshape::{ConstShape, ConstShape3u32};
use ndcopy::copy3;

type SrcShape = ConstShape3u32<50, 50, 50>;
type DstShape = ConstShape3u32<25, 25, 25>;
let src = [1u8; SrcShape::USIZE];
let mut dst = [0u8; DstShape::USIZE];

let copy_shape = [20; 3];
let src_min = [1, 2, 3];
let dst_min = [2, 3, 4];
copy3(
    copy_shape,
    &src,
    &SrcShape {},
    src_min,
    &mut dst,
    &DstShape {},
    dst_min,
);

依赖项

~74KB