I am porting a c++ code from linux to iOS.The code is using openmp to accelerate the performance. I want to know how to convert openmp code to pthread code(or gcd)? The openmp code likes below:
#pragma omp parallel num_threads(SEETA_NUM_THREADS)
{
#pragma omp for nowait
for (int32_t i = 1; i <= height; i++) {
const int32_t* top_left = int_img + (i - 1) * width_;
const int32_t* top_right = top_left + rect_width_ - 1;
const int32_t* bottom_left = top_left + rect_height_ * width_;
const int32_t* bottom_right = bottom_left + rect_width_ - 1;
int32_t* dest = rect_sum + i * width_;
*(dest++) = (*bottom_right) - (*top_right);
seeta::fd::MathFunction::VectorSub(bottom_right + 1, top_right + 1, dest, width);
seeta::fd::MathFunction::VectorSub(dest, bottom_left, dest, width);
seeta::fd::MathFunction::VectorAdd(dest, top_left, dest, width);
}
}
}