Haw*_*awk 3 c++ visual-c++ c++-amp
我正在尝试用C++编写代码 - AMP将多个2D矢量复制到GPU内存中进行处理.但是,一旦我从表达式开始,extent<2> eM(100,100);我面临这个错误:"范围"是模棱两可的.与C++中的任何其他扩展表达式是否存在冲突?是因为我使用的库?这些都是我所包含的库和命名空间,我不能包含它很长的代码并且会让人感到困惑.
#include "stdafx.h"
#include <Windows.h>
#include <stdint.h>
#include <amp.h>
#include <Shlwapi.h>
#include <vector>
#include <random>
#include <iostream>
using std::endl;
using std::cout;
#include <iomanip>
#include "timer.h"
#include <fstream>
using std::ifstream;
#include <cstring>
#include <sstream>
#include <tchar.h>
using namespace std;
using namespace concurrency;
using std::vector;
Run Code Online (Sandbox Code Playgroud)
该消息意味着编译器无法判断您是否需要std::extent或concurrency::extent.有三种方法可以解决这个问题:
#include引入的内容std::extent- 这不太可能是一个很好的解决方案,因为你可能需要来自该标题的内容concurrency::extent无论何时使用它,都要用它的全名调用- 笨拙,但会起作用using namespace std;并替换using std::endl;为您在#include语句中看到的单个语句.我喜欢最后一个最好的,虽然这是更多的工作.发现您需要的最佳方法是删除using namespace std;和编译.错误消息将告诉您正在使用的std中的哪些类型.
| 归档时间: |
|
| 查看次数: |
320 次 |
| 最近记录: |