#ray-tracing #opencl #cuda #ray-tracer

RayBNN_Raytrace

使用 CUDA、OpenCL 和 oneAPI 通过 GPU、CPU 和 FPGA 进行光线追踪的库

9 个版本 (3 个稳定版本)

2.0.3 2024年6月18日
2.0.2 2024年6月8日
0.1.6 2023年10月18日

#65科学

Download history 1/week @ 2024-05-18 1/week @ 2024-05-25 124/week @ 2024-06-01 156/week @ 2024-06-08 157/week @ 2024-06-15 9/week @ 2024-06-22 16/week @ 2024-07-06

每月下载量 516

GPL-3.0-only

53KB
992

RayBNN_Raytrace

使用 CUDA、OpenCL 和 oneAPI 通过 GPU、CPU 和 FPGA 进行光线追踪的库

追踪光线与球体、圆的交点

安装 Arrayfire

https://arrayfire.com/binaries/ 安装 Arrayfire 3.9.0 二进制文件

或从源码构建 https://github.com/arrayfire/arrayfire/wiki/Getting-ArrayFire

添加到 Cargo.toml

arrayfire = { version = "3.8.1", package = "arrayfire_fork" }
rayon = "1.10.0"
num = "0.4.3"
num-traits = "0.2.19"
half = { version = "2.4.1" , features = ["num-traits"] }
RayBNN_DataLoader = "2.0.3"
RayBNN_Sparse = "2.0.2"
RayBNN_Cell = "2.0.3"
RayBNN_Raytrace = "2.0.3"

示例列表

直线与球体交点

RayBNN_Raytrace::Intersect::Sphere::line_sphere_intersect(
    &start_line,
    &dir_line,

    &circle_center,
    &circle_radius,

    &mut intersect
);

直线与球体交点批处理

RayBNN_Raytrace::Intersect::Sphere::line_sphere_intersect_batch(
    3,
    &start_line,
    &dir_line,

    &circle_center,
    &circle_radius,

    &mut intersect
);

直线与球体交点批处理 V2

RayBNN_Raytrace::Intersect::Sphere::line_sphere_intersect_batchV2(
    3,

    1,

    &circle_center,
    &circle_radius,

    &mut start_line,
    &mut dir_line,

    &mut input_idx,
    &mut hidden_idx,
);

使用 RT3 进行光线追踪神经网络连接

RayBNN_Raytrace::Tracing::RT3::RT3_distance_limited_directly_connected(
    &modeldata_float,
    &modeldata_int,

    &glia_pos,

    &input_pos_total,
    &input_idx_total,

    &hidden_pos_total,
    &hidden_idx_total,

    
    &mut WRowIdxCOO,
    &mut WColIdx
);

依赖项

~7MB
~141K SLoC