#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
using namespace tbb;
struct Average
{
float* input;
float* output;
void operator()( const blocked_range<int>& range ) const
{
for( int i=range.begin(); i!=range.end(); ++i )
output[i] = (input[i-1]+input[i]+input[i+1])*(1/3.0f);
}
};
void ParallelAverage( float* output, float* input, size_t n )
{
Average avg;
avg.input = input;
avg.output = output;
parallel_for( blocked_range<int>( 0, n, 1000 ), avg );
}
这是我的c ++代码
当我运行此代码时,我收到错误声明,如下所示
错误1错误LNK2019:函数___ tma
中引用了未解析的外部符号_main