我可以创建restrict(amp)
功能如下:限制(安培)功能类型
auto f = [](int& item) restrict(amp) {item += 1;};
,我还可以在其他restrict(amp)
功能使用该功能,例如:
concurrency::parallel_for_each(av.extent,
[=](concurrency::index<1> idx) restrict(amp)
{
f(av[idx]);
}
);
什么而不是取代的类型编译后的“auto
”?我试图使用“std :: function”:
std::function<void (int&) restrict(amp)> f
= [](int& item) restrict(amp) {item += 1;};
但收到编译错误。
感谢您的关注!
在'std :: function'的模板参数中,函数类型似乎有问题。你尝试过:'std :: function f = ...'? –
dirkgently
它不起作用。突出智能感知错误。 – Milovidov
我对MSVC并不熟悉,但我之前听说编译器,编译器前端和IDE/Intellisense都是独立的,不是很兼容的产品,所以有人可能会抱怨其他的东西接受。买者自负。 –