Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/include/falconn/core/prefetchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class StdVectorPrefetcher<

void prefetch(const std::vector<PointType>& points,
int_fast64_t prefetch_index) {
#ifndef _MSC_VER
__builtin_prefetch((points[prefetch_index]).data(), 0, 1);
#endif
}
};

Expand All @@ -47,14 +49,20 @@ class StdVectorPrefetcher<std::vector<std::pair<IndexType, CoordinateType>>> {

void prefetch(const std::vector<PointType>& points,
int_fast64_t prefetch_index) {
#ifndef _MSC_VER
__builtin_prefetch((points[prefetch_index]).data(), 0, 1);
#endif
}
};

template <typename T>
class PlainArrayPrefetcher {
public:
#ifndef _MSC_VER
void prefetch(const T* p) { __builtin_prefetch(p, 0, 1); }
#else
void prefetch(const T* p) { ; }
#endif
};

} // namespace core
Expand Down