Skip to content

快速开始

本指南帮助你快速上手 Mini-ImagePipe。

系统要求

  • CMake >= 3.18
  • CUDA Toolkit >= 11.0
  • C++17 编译器
  • NVIDIA GPU 计算能力 >= 7.0

构建

bash
# 克隆仓库
git clone https://github.com/AICL-Lab/mini-image-pipe.git
cd mini-image-pipe

# 构建
cmake --preset release
cmake --build --preset release

# 运行测试
ctest --preset release

基本使用

cpp
#include "pipeline.h"
#include "operators/gaussian_blur.h"
#include "operators/sobel.h"

using namespace mini_image_pipe;

int main() {
    // 创建管道
    Pipeline pipeline;
    
    // 添加算子
    auto blur = std::make_shared<GaussianBlurOperator>(GaussianKernelSize::KERNEL_5x5);
    auto sobel = std::make_shared<SobelOperator>();
    
    int n1 = pipeline.addOperator("Blur", blur);
    int n2 = pipeline.addOperator("Sobel", sobel);
    
    // 连接算子
    pipeline.connect(n1, n2);
    
    // 设置输入并执行
    pipeline.setInput(n1, d_input, width, height, channels);
    pipeline.execute();
    
    // 获取输出
    void* output = pipeline.getOutput(n2);
    
    return 0;
}

下一步

基于 MIT 许可证发布