24,855
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <amp.h>
#include <amp_math.h>
using namespace std;
using namespace concurrency;
using namespace concurrency::details;
using namespace concurrency::fast_math;
void test01()
{
int aCPP[] = { 1, 2, 3,
4, 5, 6 };
//新建2维(两行三列)array_view包装器
array_view<int, 2> a(2, 3, aCPP);
index<2> idx(1, 2);
//输出6
std::cout << a(1,2) << "\n";
}
int main()
{
test01();
}
1>AMP.cpp
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\amp.h(2616): error C3861: “_Access”: 找不到标识符
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\amp.h(2616): note: “_Access”: 函数未在模板定义上下文中声明,只能通过实例化上下文中参数相关的查找找到
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\amp.h(2618): note: 编译 类 模板 成员函数 "_Value_type &Concurrency::array_view<_Value_type,2>::operator ()(const Concurrency::index<2> &) const" 时
1> with
1> [
1> _Value_type=int
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\amp.h(2650): note: 参见对正在编译的函数 模板 实例化“_Value_type &Concurrency::array_view<_Value_type,2>::operator ()(const Concurrency::index<2> &) const”的引用
1> with
1> [
1> _Value_type=int
1> ]
1>d:\testproject\c++\并行与异步\amp\amp.cpp(23): note: 参见对正在编译的 类 模板 实例化 "Concurrency::array_view<int,2>" 的引用