├── .gitignore ├── COPYING ├── Changelog.txt ├── INSTRUCTIONS.md ├── LICENSE ├── README.md ├── benchmarks ├── benchmarks_registry.json ├── bzip2 │ ├── fastflow │ │ └── bzip2_ff_farm │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_ff_farm.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ ├── grppi │ │ └── bzip2_grppi_farm │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_grppi_farm.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ ├── openmp │ │ └── bzip2_omp_farm │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_omp_farm.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ ├── sequential │ │ ├── bzip2_seq_ns │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_seq_ns.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── compress_op.hpp │ │ │ │ └── decompress_op.hpp │ │ │ │ └── src │ │ │ │ ├── compress_op.cpp │ │ │ │ └── decompress_op.cpp │ │ └── bzip2_sequential │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_sequential.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ ├── spar │ │ └── bzip2_spar_farm │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_spar_farm.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ ├── tbb │ │ └── bzip2_tbb_farm │ │ │ ├── bzip2.hpp │ │ │ ├── bzip2_tbb_farm.cpp │ │ │ ├── config.json │ │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ └── threads │ │ └── bzip2_threads_farm │ │ ├── bzip2.hpp │ │ ├── bzip2_threads_farm.cpp │ │ ├── config.json │ │ └── operators │ │ ├── include │ │ ├── compress_op.hpp │ │ └── decompress_op.hpp │ │ ├── operators.json │ │ └── src │ │ ├── compress_op.cpp │ │ └── decompress_op.cpp ├── ferret │ ├── fastflow │ │ ├── ferret_ff_a2a_pipe-farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_ff_a2a_pipe-farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_ff_farm-pipe │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_ff_farm-pipe.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_ff_farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_ff_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_ff_pipe-farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_ff_pipe-farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_ff_pipeline │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_ff_pipeline.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── grppi │ │ ├── ferret_grppi_farm-pipe │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_grppi_farm-pipe.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_grppi_farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_grppi_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_grppi_pipe-farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_grppi_pipe-farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_grppi_pipeline │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_grppi_pipeline.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── openmp │ │ ├── ferret_omp_farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_omp_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_omp_pipe-farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_omp_pipe-farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── sequential │ │ ├── ferret_seq_ns │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_seq_ns.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_sequential │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_sequential.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── spar │ │ ├── ferret_spar_farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_spar_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_spar_pipeline │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_spar_pipeline.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── tbb │ │ ├── ferret_tbb_farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_tbb_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ ├── ferret_tbb_pipe-farm │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_tbb_pipe-farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── extract_op.hpp │ │ │ │ ├── rank_op.hpp │ │ │ │ ├── segmentation_op.hpp │ │ │ │ └── vectorization_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── extract_op.cpp │ │ │ │ ├── rank_op.cpp │ │ │ │ ├── segmentation_op.cpp │ │ │ │ └── vectorization_op.cpp │ │ └── ferret_tbb_pipeline │ │ │ ├── config.json │ │ │ ├── ferret.hpp │ │ │ ├── ferret_tbb_pipeline.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ └── threads │ │ ├── ferret_threads_farm │ │ ├── config.json │ │ ├── ferret.hpp │ │ ├── ferret_threads_farm.cpp │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ │ └── ferret_threads_pipe-farm │ │ ├── config.json │ │ ├── ferret.hpp │ │ ├── ferret_threads_pipe-farm.cpp │ │ └── operators │ │ ├── include │ │ ├── extract_op.hpp │ │ ├── rank_op.hpp │ │ ├── segmentation_op.hpp │ │ └── vectorization_op.hpp │ │ ├── operators.json │ │ └── src │ │ ├── extract_op.cpp │ │ ├── rank_op.cpp │ │ ├── segmentation_op.cpp │ │ └── vectorization_op.cpp ├── global_config.json ├── lane_detection │ ├── fastflow │ │ ├── lane_ff_farm-pipe │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_ff_farm-pipe.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── bitwise_op.hpp │ │ │ │ ├── canny1_op.hpp │ │ │ │ ├── canny2_op.hpp │ │ │ │ ├── houghP_op.hpp │ │ │ │ ├── houghT_op.hpp │ │ │ │ ├── overlap_op.hpp │ │ │ │ └── segment_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── bitwise_op.cpp │ │ │ │ ├── canny1_op.cpp │ │ │ │ ├── canny2_op.cpp │ │ │ │ ├── houghP_op.cpp │ │ │ │ ├── houghT_op.cpp │ │ │ │ ├── overlap_op.cpp │ │ │ │ └── segment_op.cpp │ │ ├── lane_ff_farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_ff_farm.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── bitwise_op.hpp │ │ │ │ ├── canny1_op.hpp │ │ │ │ ├── canny2_op.hpp │ │ │ │ ├── houghP_op.hpp │ │ │ │ ├── houghT_op.hpp │ │ │ │ ├── overlap_op.hpp │ │ │ │ └── segment_op.hpp │ │ │ │ ├── operators.json │ │ │ │ └── src │ │ │ │ ├── bitwise_op.cpp │ │ │ │ ├── canny1_op.cpp │ │ │ │ ├── canny2_op.cpp │ │ │ │ ├── houghP_op.cpp │ │ │ │ ├── houghT_op.cpp │ │ │ │ ├── overlap_op.cpp │ │ │ │ └── segment_op.cpp │ │ └── lane_ff_pipe-farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_ff_pipe-farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ ├── grppi │ │ └── lane_grppi_farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_grppi_farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ ├── openmp │ │ └── lane_omp_farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_omp_farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ ├── sequential │ │ ├── lane_seq_ns │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_seq_ns.cpp │ │ │ └── operators │ │ │ │ ├── include │ │ │ │ ├── bitwise_op.hpp │ │ │ │ ├── canny1_op.hpp │ │ │ │ ├── canny2_op.hpp │ │ │ │ ├── houghP_op.hpp │ │ │ │ ├── houghT_op.hpp │ │ │ │ ├── overlap_op.hpp │ │ │ │ └── segment_op.hpp │ │ │ │ └── src │ │ │ │ ├── bitwise_op.cpp │ │ │ │ ├── canny1_op.cpp │ │ │ │ ├── canny2_op.cpp │ │ │ │ ├── houghP_op.cpp │ │ │ │ ├── houghT_op.cpp │ │ │ │ ├── overlap_op.cpp │ │ │ │ └── segment_op.cpp │ │ └── lane_sequential │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_sequential.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ ├── spar │ │ └── lane_spar_farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_spar_farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ ├── tbb │ │ └── lane_tbb_farm │ │ │ ├── config.json │ │ │ ├── lane_detection.hpp │ │ │ ├── lane_tbb_farm.cpp │ │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ └── threads │ │ └── lane_threads_farm │ │ ├── config.json │ │ ├── lane_detection.hpp │ │ ├── lane_threads_farm.cpp │ │ └── operators │ │ ├── include │ │ ├── bitwise_op.hpp │ │ ├── canny1_op.hpp │ │ ├── canny2_op.hpp │ │ ├── houghP_op.hpp │ │ ├── houghT_op.hpp │ │ ├── overlap_op.hpp │ │ └── segment_op.hpp │ │ ├── operators.json │ │ └── src │ │ ├── bitwise_op.cpp │ │ ├── canny1_op.cpp │ │ ├── canny2_op.cpp │ │ ├── houghP_op.cpp │ │ ├── houghT_op.cpp │ │ ├── overlap_op.cpp │ │ └── segment_op.cpp └── person_recognition │ ├── fastflow │ └── person_ff_farm │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_ff_farm.cpp │ │ └── person_recognition.hpp │ ├── grppi │ └── person_grppi_farm │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_grppi_farm.cpp │ │ └── person_recognition.hpp │ ├── openmp │ └── person_omp_farm │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_omp_farm.cpp │ │ └── person_recognition.hpp │ ├── sequential │ ├── person_seq_ns │ │ ├── config.json │ │ ├── operators │ │ │ ├── include │ │ │ │ ├── detect_op.hpp │ │ │ │ └── recognize_op.hpp │ │ │ └── src │ │ │ │ ├── detect_op.cpp │ │ │ │ └── recognize_op.cpp │ │ ├── person_recognition.hpp │ │ └── person_seq_ns.cpp │ └── person_sequential │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_recognition.hpp │ │ └── person_sequential.cpp │ ├── spar │ └── person_spar_farm │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_recognition.hpp │ │ └── person_spar_farm.cpp │ ├── tbb │ └── person_tbb_farm │ │ ├── config.json │ │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ │ ├── person_recognition.hpp │ │ └── person_tbb_farm.cpp │ └── threads │ └── person_threads_farm │ ├── config.json │ ├── operators │ ├── include │ │ ├── detect_op.hpp │ │ └── recognize_op.hpp │ ├── operators.json │ └── src │ │ ├── detect_op.cpp │ │ └── recognize_op.cpp │ ├── person_recognition.hpp │ └── person_threads_farm.cpp ├── doc ├── README.md └── spbench-v0.4-alpha_user-guide.pdf ├── inputs ├── get_inputs.sh └── inputs_registry.json ├── libs ├── README.md ├── bzlib │ ├── setup_bzlib.sh │ └── setup_bzlib_vars.sh ├── ffmpeg │ ├── setup_ffmpeg.sh │ └── setup_ffmpeg_vars.sh ├── gsl │ ├── setup_gsl.sh │ └── setup_gsl_vars.sh ├── install_libs.sh ├── jpeg │ ├── setup_jpeg.sh │ └── setup_jpeg_vars.sh ├── opencv │ ├── setup_opencv.sh │ └── setup_opencv_vars.sh ├── spar-shared-queue-dev │ ├── README.md │ ├── SPar_Shared_Queue.hpp │ └── example_SSQ.cpp ├── spbench │ ├── LICENSE.LESSER │ ├── spbench.cpp │ └── spbench.hpp ├── upl │ ├── setup_upl.sh │ └── setup_upl_vars.sh └── yasm │ ├── setup_yasm.sh │ └── setup_yasm_vars.sh ├── ppis ├── SPar │ └── setup_spar.sh ├── fastflow │ └── setup_fastflow.sh ├── grppi │ └── setup_grppi.sh ├── install_ppis.sh └── tbb │ ├── setup_tbb.sh │ └── setup_tbb_vars.sh ├── setup_vars.sh ├── spbench ├── src ├── CLI_testing.sh ├── LICENSE ├── __init__.py ├── clean_option.py ├── codeGenerators │ ├── __init__.py │ ├── make_gen.py │ └── new_app │ │ ├── __init__.py │ │ ├── write_app.py │ │ ├── write_app_utils.py │ │ ├── write_operators.py │ │ └── writers │ │ ├── __init__.py │ │ ├── appCpp.py │ │ ├── appHpp.py │ │ ├── appUtilCpp.py │ │ ├── appUtilHpp.py │ │ ├── generalHeader.py │ │ ├── operatorCpp.py │ │ └── operatorHpp.py ├── compile_option.py ├── configure_option.py ├── delete_app_option.py ├── delete_input_option.py ├── delete_option.py ├── download_inputs_option.py ├── edit_op_option.py ├── edit_option.py ├── errors.py ├── exec_option.py ├── global_config_option.py ├── install_option.py ├── list_apps_option.py ├── list_benchmarks_option.py ├── list_inputs_option.py ├── list_op_option.py ├── new_app_option.py ├── new_bench_option.py ├── new_input_option.py ├── new_op_option.py ├── rename_bench_option.py ├── reset_option.py ├── update_option.py └── utils │ ├── __init__.py │ ├── dict.py │ ├── shell.py │ ├── usage.py │ └── utils.py └── sys ├── apps ├── apps_registry.json ├── bzip2 │ ├── bzip2_utils.cpp │ ├── bzip2_utils.hpp │ ├── bzip2_utils_ns.cpp │ ├── bzip2_utils_ns.hpp │ ├── templates │ │ ├── bzip2.cpp │ │ ├── bzip2.hpp │ │ ├── config.json │ │ └── operators │ │ │ ├── include │ │ │ ├── compress_op.hpp │ │ │ └── decompress_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── compress_op.cpp │ │ │ └── decompress_op.cpp │ └── templates_ns │ │ ├── bzip2.cpp │ │ ├── bzip2.hpp │ │ ├── config.json │ │ └── operators │ │ ├── include │ │ ├── compress_op.hpp │ │ └── decompress_op.hpp │ │ └── src │ │ ├── compress_op.cpp │ │ └── decompress_op.cpp ├── ferret │ ├── COPYING │ ├── LICENSE │ ├── Makefile │ ├── ferret_utils.cpp │ ├── ferret_utils.hpp │ ├── ferret_utils_ns.cpp │ ├── ferret_utils_ns.hpp │ ├── image │ │ ├── Makefile │ │ ├── cass_img_extract.c │ │ ├── edge.c │ │ ├── extract.c │ │ ├── image.c │ │ ├── image.h │ │ └── srm.c │ ├── include │ │ ├── arena.h │ │ ├── cass.h │ │ ├── cass_array.h │ │ ├── cass_bench.h │ │ ├── cass_bitmap.h │ │ ├── cass_dist.h │ │ ├── cass_endian.h │ │ ├── cass_file.h │ │ ├── cass_hash.h │ │ ├── cass_heap.h │ │ ├── cass_matrix.h │ │ ├── cass_reg.h │ │ ├── cass_stat.h │ │ ├── cass_timer.h │ │ ├── cass_topk.h │ │ ├── cass_type.h │ │ ├── dat.h │ │ ├── datalog.h │ │ ├── hash_table.h │ │ ├── heap.h │ │ ├── lsh_pickpert.h │ │ ├── lsh_table.h │ │ ├── queue.h │ │ └── tpool.h │ ├── src │ │ ├── Makefile │ │ ├── arena.c │ │ ├── assign.c │ │ ├── bench.c │ │ ├── bitmap.c │ │ ├── cass.c │ │ ├── cass_dist.c │ │ ├── cass_reg.c │ │ ├── chunk_cnt.inc │ │ ├── cuckoo_hash.c │ │ ├── cuckoo_hash.h │ │ ├── dataset.c │ │ ├── dist.c │ │ ├── emd.c │ │ ├── emd.h │ │ ├── env.c │ │ ├── error.c │ │ ├── hash.c │ │ ├── hash_table.c │ │ ├── heap.c │ │ ├── import.c │ │ ├── lsh │ │ │ ├── LSH.c │ │ │ ├── LSH.h │ │ │ ├── LSH_query.c │ │ │ ├── LSH_query_batch.c │ │ │ ├── Makefile │ │ │ ├── local.c │ │ │ ├── local.h │ │ │ ├── perturb.c │ │ │ ├── perturb.h │ │ │ └── recall.c │ │ ├── map.c │ │ ├── matrix.c │ │ ├── queue.c │ │ ├── raw.c │ │ ├── stat.c │ │ ├── table.c │ │ ├── timer.c │ │ ├── topk.c │ │ ├── tp.c │ │ ├── tpool.c │ │ └── util.c │ ├── templates │ │ ├── config.json │ │ ├── ferret.cpp │ │ ├── ferret.hpp │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ ├── templates_ns │ │ ├── config.json │ │ ├── ferret.cpp │ │ ├── ferret.hpp │ │ └── operators │ │ │ ├── include │ │ │ ├── extract_op.hpp │ │ │ ├── rank_op.hpp │ │ │ ├── segmentation_op.hpp │ │ │ └── vectorization_op.hpp │ │ │ └── src │ │ │ ├── extract_op.cpp │ │ │ ├── rank_op.cpp │ │ │ ├── segmentation_op.cpp │ │ │ └── vectorization_op.cpp │ └── tools │ │ ├── Makefile │ │ ├── cass_add_cfg.c │ │ ├── cass_add_index.c │ │ ├── cass_add_map.c │ │ ├── cass_add_table.c │ │ ├── cass_add_vec_dist.c │ │ ├── cass_add_vecset_dist.c │ │ ├── cass_describe.c │ │ ├── cass_export.c │ │ ├── cass_import.c │ │ └── cass_init.c ├── lane_detection │ ├── lane_detection_utils.cpp │ ├── lane_detection_utils.hpp │ ├── lane_detection_utils_ns.cpp │ ├── lane_detection_utils_ns.hpp │ ├── linefinder.h │ ├── templates │ │ ├── config.json │ │ ├── lane_detection.cpp │ │ ├── lane_detection.hpp │ │ └── operators │ │ │ ├── include │ │ │ ├── bitwise_op.hpp │ │ │ ├── canny1_op.hpp │ │ │ ├── canny2_op.hpp │ │ │ ├── houghP_op.hpp │ │ │ ├── houghT_op.hpp │ │ │ ├── overlap_op.hpp │ │ │ └── segment_op.hpp │ │ │ ├── operators.json │ │ │ └── src │ │ │ ├── bitwise_op.cpp │ │ │ ├── canny1_op.cpp │ │ │ ├── canny2_op.cpp │ │ │ ├── houghP_op.cpp │ │ │ ├── houghT_op.cpp │ │ │ ├── overlap_op.cpp │ │ │ └── segment_op.cpp │ └── templates_ns │ │ ├── config.json │ │ ├── lane_detection.cpp │ │ ├── lane_detection.hpp │ │ └── operators │ │ ├── include │ │ ├── bitwise_op.hpp │ │ ├── canny1_op.hpp │ │ ├── canny2_op.hpp │ │ ├── houghP_op.hpp │ │ ├── houghT_op.hpp │ │ ├── overlap_op.hpp │ │ └── segment_op.hpp │ │ └── src │ │ ├── bitwise_op.cpp │ │ ├── canny1_op.cpp │ │ ├── canny2_op.cpp │ │ ├── houghP_op.cpp │ │ ├── houghT_op.cpp │ │ ├── overlap_op.cpp │ │ └── segment_op.cpp └── person_recognition │ ├── person_recognition_utils.cpp │ ├── person_recognition_utils.hpp │ ├── person_recognition_utils_ns.cpp │ ├── person_recognition_utils_ns.hpp │ ├── templates │ ├── config.json │ ├── operators │ │ ├── include │ │ │ ├── detect_op.hpp │ │ │ └── recognize_op.hpp │ │ ├── operators.json │ │ └── src │ │ │ ├── detect_op.cpp │ │ │ └── recognize_op.cpp │ ├── person_recognition.cpp │ └── person_recognition.hpp │ └── templates_ns │ ├── config.json │ ├── operators │ ├── include │ │ ├── detect_op.hpp │ │ └── recognize_op.hpp │ └── src │ │ ├── detect_op.cpp │ │ └── recognize_op.cpp │ ├── person_recognition.cpp │ └── person_recognition.hpp └── templates └── simple_app_template.cpp /INSTRUCTIONS.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | 3 | The framework works with a command-line interface (CLI). 4 | 5 | The CLI offers some commands. You can check them running: 6 | 7 | `./spbench --help` 8 | 9 | For each command there is also a "help" guide. You can access it using: 10 | 11 | `./spbench [command] -h` 12 | 13 | See the full and updated documentation is available at [https://spbench-doc.rtfd.io](https://spbench-doc.rtfd.io). 14 | 15 | Alternatively, you can find a PDF version of it in the doc folder. -------------------------------------------------------------------------------- /benchmarks/bzip2/fastflow/bzip2_ff_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/fastflow/bzip2_ff_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/fastflow/bzip2_ff_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/grppi/bzip2_grppi_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/grppi/bzip2_grppi_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/grppi/bzip2_grppi_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/openmp/bzip2_omp_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/openmp/bzip2_omp_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/openmp/bzip2_omp_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/sequential/bzip2_sequential/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/sequential/bzip2_sequential/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/sequential/bzip2_sequential/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/spar/bzip2_spar_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/spar/bzip2_spar_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/spar/bzip2_spar_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/tbb/bzip2_tbb_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/tbb/bzip2_tbb_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/tbb/bzip2_tbb_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/threads/bzip2_threads_farm/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/threads/bzip2_threads_farm/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/bzip2/threads/bzip2_threads_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_a2a_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm-pipe/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/fastflow/ferret_ff_pipeline/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm-pipe/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/grppi/ferret_grppi_pipeline/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/openmp/ferret_omp_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_seq_ns/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_seq_ns/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/ferret_sequential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) { 4 | 5 | spb::init_bench(argc, argv); 6 | spb::Metrics::init(); 7 | 8 | while(1) { 9 | spb::Item item; 10 | if(!spb::Source::op(item)) break; 11 | spb::Segmentation::op(item); 12 | spb::Extract::op(item); 13 | spb::Vectorization::op(item); 14 | spb::Rank::op(item); 15 | spb::Sink::op(item); 16 | } 17 | spb::Metrics::stop(); 18 | spb::end_bench(); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/sequential/ferret_sequential/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | using namespace spb; 4 | 5 | inline void Extract::extract_op(item_data &item){ 6 | 7 | item.extract.name = item.second.seg.name; 8 | image_extract_helper(item.second.seg.HSV, 9 | item.second.seg.mask, 10 | item.second.seg.width, 11 | item.second.seg.height, 12 | item.second.seg.nrgn, 13 | &item.extract.ds); 14 | free(item.second.seg.mask); 15 | free(item.second.seg.HSV); 16 | 17 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | using namespace spb; 4 | 5 | inline void Segmentation::segmentation_op(item_data &item){ 6 | 7 | item.second.seg.name = item.first.load.name; 8 | item.second.seg.width = item.first.load.width; 9 | item.second.seg.height = item.first.load.height; 10 | item.second.seg.HSV = item.first.load.HSV; 11 | image_segment((void**)&item.second.seg.mask, 12 | &item.second.seg.nrgn, 13 | item.first.load.RGB, 14 | item.first.load.width, 15 | item.first.load.height); 16 | free(item.first.load.RGB); 17 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | using namespace spb; 4 | 5 | inline void Extract::extract_op(item_data &item){ 6 | 7 | item.extract.name = item.second.seg.name; 8 | image_extract_helper(item.second.seg.HSV, 9 | item.second.seg.mask, 10 | item.second.seg.width, 11 | item.second.seg.height, 12 | item.second.seg.nrgn, 13 | &item.extract.ds); 14 | free(item.second.seg.mask); 15 | free(item.second.seg.HSV); 16 | 17 | } -------------------------------------------------------------------------------- /benchmarks/ferret/spar/ferret_spar_pipeline/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | using namespace spb; 4 | 5 | inline void Segmentation::segmentation_op(item_data &item){ 6 | 7 | item.second.seg.name = item.first.load.name; 8 | item.second.seg.width = item.first.load.width; 9 | item.second.seg.height = item.first.load.height; 10 | item.second.seg.HSV = item.first.load.HSV; 11 | image_segment((void**)&item.second.seg.mask, 12 | &item.second.seg.nrgn, 13 | item.first.load.RGB, 14 | item.first.load.width, 15 | item.first.load.height); 16 | free(item.first.load.RGB); 17 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/tbb/ferret_tbb_pipeline/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /benchmarks/ferret/threads/ferret_threads_pipe-farm/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm-pipe/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/fastflow/lane_ff_pipe-farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/grppi/lane_grppi_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/openmp/lane_omp_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Bitwise::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | bitwise_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Canny1::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny1_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Canny2::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void HoughP::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghP_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void HoughT::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Overlap::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | overlap_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Segment::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_seq_ns/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/sequential/lane_sequential/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | using namespace spb; 4 | using namespace cv; 5 | 6 | inline void Bitwise::bitwise_op(item_data &item){ 7 | 8 | //bitwise AND of the two hough images 9 | bitwise_and(item.houghP, item.hough, item.houghP); 10 | Mat houghPinv(item.imgROI.size(), CV_8U, Scalar(0)); 11 | //threshold and invert to black lines 12 | threshold(item.houghP, houghPinv, 150, 255, THRESH_BINARY_INV); 13 | 14 | item.houghPinv = houghPinv; 15 | 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | using namespace spb; 4 | using namespace cv; 5 | 6 | inline void Canny1::canny1_op(item_data &item){ 7 | //Mat contours; 8 | Canny(item.imgROI, item.contours,50,250); 9 | Mat contoursInv; 10 | threshold(item.contours, contoursInv, 128, 255, THRESH_BINARY_INV); 11 | } 12 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | using namespace spb; 4 | using namespace cv; 5 | 6 | inline void Canny2::canny2_op(item_data &item){ 7 | 8 | Canny(item.houghPinv, item.contours, 100, 350); 9 | item.li = item.ld.findLines(item.contours); 10 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/spar/lane_spar_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | using namespace spb; 4 | using namespace cv; 5 | 6 | inline void HoughP::houghP_op(item_data &item){ 7 | 8 | //set probabilistic Hough parameters 9 | item.ld.setLineLengthAndGap(60,10); 10 | item.ld.setMinVote(4); 11 | 12 | //detect lines 13 | item.li = item.ld.findLines(item.contours); 14 | Mat houghP(item.imgROI.size(), CV_8U, Scalar(0)); 15 | item.ld.setShift(0); 16 | item.ld.drawDetectedLines(houghP); 17 | 18 | item.houghP = houghP; 19 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/tbb/lane_tbb_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /benchmarks/lane_detection/threads/lane_threads_farm/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/fastflow/person_ff_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/fastflow/person_ff_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/grppi/person_grppi_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/grppi/person_grppi_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/openmp/person_omp_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/openmp/person_omp_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/sequential/person_sequential/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/sequential/person_sequential/person_sequential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main (int argc, char* argv[]){ 4 | // Disabling internal OpenCV's support for multithreading 5 | cv::setNumThreads(0); 6 | spb::init_bench(argc, argv); // Initializations 7 | spb::Metrics::init(); 8 | while(1){ 9 | spb::Item item; 10 | if(!spb::Source::op(item)) break; 11 | spb::Detect::op(item); //detect faces in the image: 12 | spb::Recognize::op(item); //analyze each detected face: 13 | spb::Sink::op(item); 14 | } 15 | spb::Metrics::stop(); 16 | spb::end_bench(); 17 | return 0; 18 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/spar/person_spar_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/spar/person_spar_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/tbb/person_tbb_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/tbb/person_tbb_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/threads/person_threads_farm/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /benchmarks/person_recognition/threads/person_threads_farm/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # SPBench Documentation 2 | 3 | The updated SPBench documentation for users is available at https://spbench-doc.rtfd.io 4 | 5 | In this directory you can find a PDF version of the documentaion available online. 6 | 7 | -------------------------------------------------------------------------------- /doc/spbench-v0.4-alpha_user-guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GMAP/SPBench/18e52385d1d75546025582f0497a7f1c02540abc/doc/spbench-v0.4-alpha_user-guide.pdf -------------------------------------------------------------------------------- /libs/bzlib/setup_bzlib_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | export PATH=$LIB_DIR/bin:$PATH 6 | export LD_LIBRARY_PATH=$LIB_DIR/lib:$PWD/include:$LD_LIBRARY_PATH 7 | -------------------------------------------------------------------------------- /libs/ffmpeg/setup_ffmpeg_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | FFMPEG_HOME=$LIB_DIR/ffmpeg-3.4.8/build 6 | export PATH=${FFMPEG_HOME}/bin:$PATH 7 | export LD_LIBRARY_PATH=${FFMPEG_HOME}/lib:${FFMPEG_HOME}/include:$LD_LIBRARY_PATH 8 | export PKG_CONFIG_PATH=${FFMPEG_HOME}/lib/pkgconfig:$PKG_CONFIG_PATH 9 | -------------------------------------------------------------------------------- /libs/gsl/setup_gsl_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | GSL_HOME=$LIB_DIR/gsl-2.6/build 6 | export PATH=${GSL_HOME}/bin:$PATH 7 | export LD_LIBRARY_PATH=${GSL_HOME}/lib:${GSL_HOME}/include:$LD_LIBRARY_PATH 8 | export LD_RUN_PATH=${GSL_HOME}/lib:$LD_RUN_PATH 9 | export PKG_CONFIG_PATH=${GSL_HOME}/lib/pkgconfig:$PKG_CONFIG_PATH 10 | -------------------------------------------------------------------------------- /libs/jpeg/setup_jpeg_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | JPEG_HOME=$LIB_DIR/libjpeg-turbo-1.5.2/build 6 | export PATH=${JPEG_HOME}/bin:$PATH 7 | export LD_LIBRARY_PATH=${JPEG_HOME}/lib:${JPEG_HOME}/include:$LD_LIBRARY_PATH 8 | export LD_RUN_PATH=${JPEG_HOME}/lib:$LD_RUN_PATH 9 | export PKG_CONFIG_PATH=${JPEG_HOME}/lib/pkgconfig:$PKG_CONFIG_PATH 10 | -------------------------------------------------------------------------------- /libs/opencv/setup_opencv_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | OPENCV_HOME=$LIB_DIR/opencv-2.4.13.6 6 | export PATH=${OPENCV_HOME}/bin:$PATH 7 | export LD_LIBRARY_PATH=${OPENCV_HOME}/lib:${OPENCV_HOME}/include:$LD_LIBRARY_PATH 8 | export PKG_CONFIG_PATH=${OPENCV_HOME}/lib/pkgconfig:$PKG_CONFIG_PATH 9 | -------------------------------------------------------------------------------- /libs/upl/setup_upl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | cd $THIS_DIR 5 | 6 | wget -c --read-timeout=5 --tries=10 https://gmap.pucrs.br/public_data/spbench/libs/upl/upl.tar.gz 7 | 8 | tar -xf upl.tar.gz 9 | rm upl.tar.gz 10 | -------------------------------------------------------------------------------- /libs/upl/setup_upl_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | -------------------------------------------------------------------------------- /libs/yasm/setup_yasm_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | YASM_HOME=$LIB_DIR/yasm-1.3.0/build 6 | export PATH=${YASM_HOME}/bin:$PATH 7 | export LD_LIBRARY_PATH=${YASM_HOME}/lib:${YASM_HOME}/include:$LD_LIBRARY_PATH 8 | -------------------------------------------------------------------------------- /ppis/SPar/setup_spar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | wget -c --read-timeout=5 --tries=10 https://gmap.pucrs.br/public_data/spbench/libs/spar/spar.tar.gz 4 | 5 | tar -xf spar.tar.gz 6 | make 7 | 8 | rm spar.tar.gz 9 | -------------------------------------------------------------------------------- /ppis/fastflow/setup_fastflow.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | cd $THIS_DIR 5 | 6 | wget -c --read-timeout=5 --tries=10 https://gmap.pucrs.br/public_data/spbench/libs/fastflow/fastflow.tar.gz 7 | 8 | tar -xf fastflow.tar.gz 9 | 10 | rm fastflow.tar.gz 11 | -------------------------------------------------------------------------------- /ppis/tbb/setup_tbb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | cd $THIS_DIR 5 | 6 | FILE=tbb.tar.gz 7 | 8 | if [ ! -f "$FILE" ]; then 9 | echo "Downloading $FILE..." 10 | wget -c --read-timeout=5 --tries=10 https://gmap.pucrs.br/public_data/spbench/libs/tbb/$FILE 11 | fi 12 | 13 | 14 | tar -xf $FILE 15 | cd tbb 16 | cmake CMakeLists.txt 17 | make tbb -j$(nproc) 18 | cd .. 19 | -------------------------------------------------------------------------------- /ppis/tbb/setup_tbb_vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" 4 | 5 | TBB_HOME=$LIB_DIR/tbb 6 | export LD_LIBRARY_PATH=${TBB_HOME}:${TBB_HOME}/include:$LD_LIBRARY_PATH 7 | -------------------------------------------------------------------------------- /setup_vars.sh: -------------------------------------------------------------------------------- 1 | # This script set the environment variables for all libraries 2 | # (You must install them first, see libs/README.md for more info) 3 | source ppis/tbb/setup_tbb_vars.sh 4 | source libs/yasm/setup_yasm_vars.sh 5 | source libs/opencv/setup_opencv_vars.sh 6 | source libs/ffmpeg/setup_ffmpeg_vars.sh 7 | source libs/bzlib/setup_bzlib_vars.sh 8 | source libs/gsl/setup_gsl_vars.sh 9 | source libs/jpeg/setup_jpeg_vars.sh -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- 1 | #here 2 | -------------------------------------------------------------------------------- /src/codeGenerators/__init__.py: -------------------------------------------------------------------------------- 1 | #here 2 | -------------------------------------------------------------------------------- /src/codeGenerators/new_app/__init__.py: -------------------------------------------------------------------------------- 1 | #here 2 | -------------------------------------------------------------------------------- /src/codeGenerators/new_app/writers/__init__.py: -------------------------------------------------------------------------------- 1 | #here 2 | -------------------------------------------------------------------------------- /src/errors.py: -------------------------------------------------------------------------------- 1 | 2 | class ErrorClass(Exception): 3 | """An error from creating or using an argument (optional or positional). 4 | 5 | The string value of this exception is the message, augmented with 6 | information about the argument that caused it. 7 | """ 8 | 9 | def __init__(self, message): 10 | self.message = message 11 | def __str__(self): 12 | return self.message 13 | 14 | class ArgumentTypeError(ErrorClass): 15 | pass -------------------------------------------------------------------------------- /src/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #here 2 | -------------------------------------------------------------------------------- /sys/apps/bzip2/templates/bzip2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void compress(){ 4 | spb::Metrics::init(); 5 | while(1){ 6 | spb::Item item; 7 | if(!spb::Source::op(item)) break; 8 | spb::Compress::op(item); 9 | spb::Sink::op(item); 10 | } 11 | spb::Metrics::stop(); 12 | } 13 | 14 | void decompress(){ 15 | spb::Metrics::init(); 16 | while(1){ 17 | spb::Item item; 18 | if(!spb::Source_d::op(item)) break; 19 | spb::Decompress::op(item); 20 | spb::Sink_d::op(item); 21 | } 22 | spb::Metrics::stop(); 23 | } 24 | 25 | int main (int argc, char* argv[]){ 26 | spb::bzip2_main(argc, argv); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /sys/apps/bzip2/templates/operators/include/compress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Compress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | compress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/bzip2/templates/operators/include/decompress_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Decompress::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | decompress_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/bzip2/templates/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "compress" : "", 3 | "decompress" : "" 4 | } -------------------------------------------------------------------------------- /sys/apps/ferret/image/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | all: 4 | cd ..; $(MAKE) image 5 | -------------------------------------------------------------------------------- /sys/apps/ferret/include/arena.h: -------------------------------------------------------------------------------- 1 | #ifndef _ARENA_H_ 2 | #define _ARENA_H_ 3 | #if defined(__cplusplus) 4 | extern "C" { 5 | #endif 6 | 7 | typedef struct MemArena MemArena; 8 | 9 | MemArena *mkmemarena(void *(*)(size_t), void *(*)(void*, size_t), void (*)(void*), unsigned long); 10 | void freememarena(MemArena*); 11 | void memarenastats(MemArena*); 12 | void *memarenamalloc(MemArena*, unsigned long); 13 | #if defined(__cplusplus) 14 | } 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /sys/apps/ferret/include/cass_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMER_H_ 2 | #define _TIMER_H_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | typedef struct { 11 | struct timeval start, end; 12 | float diff; 13 | } stimer_t; 14 | 15 | void stimer_tick(stimer_t *timer); 16 | 17 | float stimer_tuck(stimer_t *timer, const char *msg); 18 | 19 | #ifdef __cplusplus 20 | }; 21 | #endif 22 | 23 | #endif /* _TIMER_H_ */ 24 | -------------------------------------------------------------------------------- /sys/apps/ferret/include/dat.h: -------------------------------------------------------------------------------- 1 | #define LONG(p) (((p)[0]<<24)|((p)[1]<<16)|((p)[2]<<8)|((p)[3])) 2 | #define PLONG(p, l) (((p)[0]=(l)>>24),((p)[1]=(l)>>16),\ 3 | ((p)[2]=(l)>>8),((p)[3]=((uchar)(l)))) 4 | #define SHORT(p) (((p)[0]<<8)|(p)[1]) 5 | #define PSHORT(p,l) (((p)[0]=(l)>>8),((p)[1]=((uchar)(l)))) 6 | 7 | #ifndef ctassert /* Allow lint to override */ 8 | #define ctassert(x) _ctassert(x, __LINE__) 9 | #define _ctassert(x, y) __ctassert(x, y) 10 | #define __ctassert(x, y) typedef char __assert ## y[(x) ? 1 : -1] 11 | #endif 12 | -------------------------------------------------------------------------------- /sys/apps/ferret/include/queue.h: -------------------------------------------------------------------------------- 1 | #ifndef QUEUE_H 2 | #define QUEUE_H 3 | 4 | #include 5 | 6 | struct queue { 7 | int head, tail; 8 | void ** data; 9 | int size; 10 | int prod_threads; // no of producing threads 11 | int end_count; 12 | pthread_mutex_t mutex; 13 | pthread_cond_t empty, full; 14 | }; 15 | 16 | void queue_signal_terminate(struct queue * que); 17 | void queue_init(struct queue* que, int size, int prod_threads); 18 | void queue_destroy(struct queue* que); 19 | int dequeue(struct queue* que, void** to_buf); 20 | void enqueue(struct queue* que, void* from_buf); 21 | 22 | #endif //QUEUE 23 | -------------------------------------------------------------------------------- /sys/apps/ferret/src/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | all: 4 | cd ..; $(MAKE) lib 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sys/apps/ferret/src/lsh/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all clean 2 | 3 | all: liblsh.a 4 | 5 | clean: 6 | rm *.o liblsh.a 7 | 8 | liblsh.a: $(OBJS) 9 | ar r $@ $^ 10 | ranlib $@ 11 | 12 | C_SRC = *.c 13 | CXX_SRC = *.cpp 14 | OBJS = $(C_SRC:%.c=%.o) $(CXX_SRC:%.cpp=%.o) 15 | 16 | all: $(LIBDIR)/liblsh.a 17 | make -C lsh 18 | 19 | clean: 20 | rm $(LIBDIR)/libcass.a *.o 21 | make -C lsh clean 22 | 23 | $(LIBDIR)/libcass.a: $(OBJS) 24 | ar r $@ $^ 25 | ranlib $@ 26 | -------------------------------------------------------------------------------- /sys/apps/ferret/src/lsh/local.h: -------------------------------------------------------------------------------- 1 | #ifndef __WDONG_LOCAL__ 2 | #define __WDONG_LOCAL__ 3 | 4 | /* y = a + b x */ 5 | static inline void least_squares (double *a, double *b, int n, double sxx, double sxy, double sx, double sy) 6 | { 7 | *b = (n * sxy - sx*sy) / (n * sxx - sx*sx); 8 | *a = (sy - *b * sx) / n; 9 | } 10 | 11 | int localdim (double a, double b, double *alpha, double *beta, double W, int M, int L, int K); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /sys/apps/ferret/src/lsh/perturb.h: -------------------------------------------------------------------------------- 1 | #ifndef __PERTURB__ 2 | #define __PERTURB__ 3 | 4 | typedef struct 5 | { 6 | unsigned long long set; 7 | float key; 8 | unsigned dir; 9 | unsigned max; 10 | float key1; 11 | } ptb_vec_t; 12 | 13 | ptb_vec_t *gen_score (int M); 14 | 15 | int gen_perturb_set (const ptb_vec_t *score, ptb_vec_t *set, int M, int T); 16 | 17 | int map_perturb_vector (const ptb_vec_t set[], ptb_vec_t vector[], const ptb_vec_t mapping[], int M, int T); 18 | 19 | void ptb_qsort (ptb_vec_t *, cass_size_t); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /sys/apps/ferret/templates/ferret.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) { 4 | 5 | spb::init_bench(argc, argv); 6 | spb::Metrics::init(); 7 | 8 | while(1) { 9 | spb::Item item; 10 | if(!spb::Source::op(item)) break; 11 | spb::Segmentation::op(item); 12 | spb::Extract::op(item); 13 | spb::Vectorization::op(item); 14 | spb::Rank::op(item); 15 | spb::Sink::op(item); 16 | } 17 | spb::Metrics::stop(); 18 | spb::end_bench(); 19 | return 0; 20 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/include/extract_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Extract::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | extract_op(*item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Rank::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | rank_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/include/segmentation_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segmentation::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segmentation_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/include/vectorization_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Vectorization::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | vectorization_op(*item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "extract" : "", 3 | "rank" : "", 4 | "segmentation" : "", 5 | "vectorization" : "" 6 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates_ns/operators/include/rank_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Rank::op(Item &item){ 5 | 6 | if(item.empty()) 7 | return; 8 | 9 | Metrics metrics; 10 | volatile unsigned long latency_op; 11 | if(metrics.latency_is_enabled()){ 12 | latency_op = current_time_usecs(); 13 | } 14 | unsigned int num_item = 0; 15 | 16 | while(num_item < item.batch_size){ //batch loop 17 | 18 | rank_op(*item.item_batch[num_item]); 19 | 20 | num_item++; 21 | } 22 | 23 | if(metrics.latency_is_enabled()){ 24 | item.latency_op.push_back(current_time_usecs() - latency_op); 25 | } 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates_ns/operators/src/extract_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/extract_op.hpp> 2 | 3 | inline void spb::Extract::extract_op(spb::item_data &item){ 4 | 5 | item.extract.name = item.second.seg.name; 6 | image_extract_helper(item.second.seg.HSV, 7 | item.second.seg.mask, 8 | item.second.seg.width, 9 | item.second.seg.height, 10 | item.second.seg.nrgn, 11 | &item.extract.ds); 12 | free(item.second.seg.mask); 13 | free(item.second.seg.HSV); 14 | 15 | } -------------------------------------------------------------------------------- /sys/apps/ferret/templates_ns/operators/src/segmentation_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/segmentation_op.hpp> 2 | 3 | inline void spb::Segmentation::segmentation_op(spb::item_data &item){ 4 | 5 | item.second.seg.name = item.first.load.name; 6 | item.second.seg.width = item.first.load.width; 7 | item.second.seg.height = item.first.load.height; 8 | item.second.seg.HSV = item.first.load.HSV; 9 | image_segment((void**)&item.second.seg.mask, 10 | &item.second.seg.nrgn, 11 | item.first.load.RGB, 12 | item.first.load.width, 13 | item.first.load.height); 14 | free(item.first.load.RGB); 15 | } -------------------------------------------------------------------------------- /sys/apps/ferret/tools/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | cd ..; $(MAKE) tools 4 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Bitwise::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | bitwise_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny1::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | canny1_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Canny2::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughP::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | houghP_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void HoughT::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Overlap::op(Item &item){ 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | overlap_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Segment::op(Item &item){ Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise" : "", 3 | "canny1" : "", 4 | "canny2" : "", 5 | "houghP" : "", 6 | "houghT" : "", 7 | "overlap" : "", 8 | "segment" : "" 9 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/bitwise_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Bitwise::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | bitwise_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/canny1_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Canny1::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny1_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/canny2_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Canny2::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | canny2_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/houghP_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void HoughP::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghP_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/houghT_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void HoughT::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | houghT_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/overlap_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Overlap::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | overlap_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/include/segment_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Segment::op(Item &item){ 5 | Metrics metrics; 6 | volatile unsigned long latency_op; 7 | if(metrics.latency_is_enabled()){ 8 | latency_op = current_time_usecs(); 9 | } 10 | unsigned int num_item = 0; 11 | 12 | while(num_item < item.batch_size){ //batch loop 13 | 14 | segment_op(item.item_batch[num_item]); 15 | 16 | num_item++; 17 | } 18 | 19 | if(metrics.latency_is_enabled()){ 20 | item.latency_op.push_back(current_time_usecs() - latency_op); 21 | } 22 | } 23 | 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/src/bitwise_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/bitwise_op.hpp> 2 | 3 | inline void spb::Bitwise::bitwise_op(spb::item_data &item){ 4 | 5 | //bitwise AND of the two hough images 6 | cv::bitwise_and(item.houghP, item.hough, item.houghP); 7 | cv::Mat houghPinv(item.imgROI.size(), CV_8U, cv::Scalar(0)); 8 | //threshold and invert to black lines 9 | cv::threshold(item.houghP, houghPinv, 150, 255, cv::THRESH_BINARY_INV); 10 | 11 | item.houghPinv = houghPinv; 12 | 13 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/src/canny1_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny1_op.hpp> 2 | 3 | inline void spb::Canny1::canny1_op(spb::item_data &item){ 4 | //Mat contours; 5 | cv::Canny(item.imgROI, item.contours,50,250); 6 | cv::Mat contoursInv; 7 | cv::threshold(item.contours, contoursInv, 128, 255, cv::THRESH_BINARY_INV); 8 | } 9 | -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/src/canny2_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/canny2_op.hpp> 2 | 3 | inline void spb::Canny2::canny2_op(spb::item_data &item){ 4 | 5 | cv::Canny(item.houghPinv, item.contours, 100, 350); 6 | item.li = item.ld.findLines(item.contours); 7 | } -------------------------------------------------------------------------------- /sys/apps/lane_detection/templates_ns/operators/src/houghP_op.cpp: -------------------------------------------------------------------------------- 1 | #include <../include/houghP_op.hpp> 2 | 3 | inline void spb::HoughP::houghP_op(spb::item_data &item){ 4 | 5 | //set probabilistic Hough parameters 6 | item.ld.setLineLengthAndGap(60,10); 7 | item.ld.setMinVote(4); 8 | 9 | //detect lines 10 | item.li = item.ld.findLines(item.contours); 11 | cv::Mat houghP(item.imgROI.size(), CV_8U, cv::Scalar(0)); 12 | item.ld.setShift(0); 13 | item.ld.drawDetectedLines(houghP); 14 | 15 | item.houghP = houghP; 16 | } -------------------------------------------------------------------------------- /sys/apps/person_recognition/templates/operators/include/detect_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | void Detect::op(Item &item){ 5 | 6 | Metrics metrics; 7 | volatile unsigned long latency_op; 8 | if(metrics.latency_is_enabled()){ 9 | latency_op = current_time_usecs(); 10 | } 11 | unsigned int num_item = 0; 12 | 13 | while(num_item < item.batch_size){ //batch loop 14 | 15 | detect_op(item.item_batch[num_item]); 16 | 17 | num_item++; 18 | } 19 | 20 | if(metrics.latency_is_enabled()){ 21 | item.latency_op.push_back(current_time_usecs() - latency_op); 22 | } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /sys/apps/person_recognition/templates/operators/include/recognize_op.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace spb{ 4 | 5 | void Recognize::op(Item &item){ 6 | 7 | Metrics metrics; 8 | volatile unsigned long latency_op; 9 | if(metrics.latency_is_enabled()){ 10 | latency_op = current_time_usecs(); 11 | } 12 | unsigned int num_item = 0; 13 | 14 | while(num_item < item.batch_size){ //batch loop 15 | 16 | recognize_op(item.item_batch[num_item]); 17 | 18 | num_item++; 19 | } 20 | 21 | if(metrics.latency_is_enabled()){ 22 | item.latency_op.push_back(current_time_usecs() - latency_op); 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /sys/apps/person_recognition/templates/operators/operators.json: -------------------------------------------------------------------------------- 1 | { 2 | "detect" : "", 3 | "recognize" : "" 4 | } -------------------------------------------------------------------------------- /sys/apps/person_recognition/templates/person_recognition.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main (int argc, char* argv[]){ 4 | // Disabling internal OpenCV's support for multithreading 5 | cv::setNumThreads(0); 6 | spb::init_bench(argc, argv); // Initializations 7 | spb::Metrics::init(); 8 | while(1){ 9 | spb::Item item; 10 | if(!spb::Source::op(item)) break; 11 | spb::Detect::op(item); //detect faces in the image: 12 | spb::Recognize::op(item); //analyze each detected face: 13 | spb::Sink::op(item); 14 | } 15 | spb::Metrics::stop(); 16 | spb::end_bench(); 17 | return 0; 18 | } 19 | 20 | --------------------------------------------------------------------------------