错误:未在此范围内声明'_mm_prefetch'
error: '_mm_prefetch' was not declared in this scope
我正在用g++4.7在redhat Linux上编译一段算法代码,但是遇到了一些问题。一个c++文件使用的头文件如下:
但是在编译时,会出现一些错误,例如
error: '_mm_prefetch' was not declared in this scope
error: '_MM_HINT_T0' was not declared in this scope
我怎样才能解决这个问题?非常感谢!!
#include <cmath>
#include <memory>
#include <iostream>
#include <mmintrin.h>
#include "space.h"
#include "knnquery.h"
#include "rangequery.h"
#include "ported_boost_progress.h"
#include "method/small_world_rand.h"
#include "sort_arr_bi.h"
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <typeinfo>
//#define START_WITH_E0
#define START_WITH_E0_AT_QUERY_TIME
#define USE_BITSET_FOR_INDEXING 1
//#define USE_ALTERNATIVE_FOR_INDEXING
namespace similarity {
using namespace std;
template <typename dist_t>
struct IndexThreadParamsSW {
const Space<dist_t>& space_;
SmallWorldRand<dist_t>& index_;
const ObjectVector& data_;
在这个c++文件中,有一个地方使用了这些代码:
for (MSWNode* neighbor : (currEv.getMSWNode())->getAllFriends()) {
_mm_prefetch(reinterpret_cast<const char*>(const_cast<const Object*>(neighbor->getData())), _MM_HINT_T0);
}
for (MSWNode* neighbor : (currEv.getMSWNode())->getAllFriends()) {
_mm_prefetch(const_cast<const char*>(neighbor->getData()->data()), _MM_HINT_T0);
}
除了<mmintrin.h>
,您还需要包括<xmmintrin.h>
相关文章:
- 如何在C++中将 chrono::秒转换为 HH:MM:SS 格式的字符串?
- 如何从远程 SFTP 服务器获取 HH-MM-SS 时间戳格式的文件列表
- 将 hh:mm:ss.zzz 时间 QString 转换为毫秒的单行函数?
- 格式化时间 c++ dd/mm/yyyy hh:ss.
- 如何将鼠标坐标转换为"mm"
- 如何在C++中将秒更改为 HH:MM:SS 格式?
- 将源文件扩展名从 .m 更改为 .mm 在屏幕保护程序项目的 Xcode 9.3 中失败
- -MM 标志在 g++ 中有什么作用
- 如何以"hh:mm:ss"格式读取C ++中的HH,MM和SS
- 从用户那里获取"yyyy/mm/dd, hh:mm"形式的日期输入并验证C++中的日期?
- 在 C++11 中表示日内时间 HH:MM:SS 的最佳方法是什么?
- 从 ObjC 代码调用 .mm 类方法时编译错误
- C - 用STD :: difftime编写调度程序 - 如何在白天检查时间(HH:MM:SS)
- 如何在 Xcode Objective-C Project 中的 .mm 类扩展中导入/使用 swift 静态库/框架
- C++ 用户输入的字符串必须采用 DD-MM-YYYY 格式
- 以 hh:mm 格式添加时间,C++
- cygwin上的gcc -MM:有时是Unix风格的路径
- 从工作iOS项目中导入.cpp文件并将其重命名为.mm问题
- 正在尝试将time_t数据类型转换为(dd/mm/yyyy)格式C++
- 为什么 g++ -MM 选项忽略当前工作目录的包含文件