C++ Adding 2 arrays together quickly

前端 未结 6 1680
一整个雨季
一整个雨季 2021-02-04 16:57

Given the arrays:

int canvas[10][10];
int addon[10][10];

Where all the values range from 0 - 100, what is the fastest way in C++ to add

6条回答
  •  滥情空心
    2021-02-04 17:20

    You should check out CUDA. This kind of problem is right up CUDA's street. Recommend the Programming Massively Parallel Processors book.

    However, this does require CUDA capable hardware, and CUDA takes a bit of effort to get setup in your development environment, so it would depend how important this really is!

    Good luck!

提交回复
热议问题