Skip to content

Commit

Permalink
Fix FBGEMM OSS CI (pytorch#212)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#212

^

(Note: this ignores all push blocking failures!)

Reviewed By: jianyuh

Differential Revision: D18910255

fbshipit-source-id: 21b4ecd3fb69e09c13227fbdd465fb6de1a4ad8c
  • Loading branch information
efiks authored and jspark1105 committed Mar 21, 2020
1 parent c79a563 commit c31324f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bench/BenchUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/
#pragma once
#include <chrono>
#include <vector>
#include <functional>
#include <vector>

#include <immintrin.h>

Expand All @@ -33,7 +33,7 @@ void cache_evict(const T& vec) {
auto const dataSize = size * elemSize;

const char* data = (const char*)vec.data();
for(auto i = 0; i < dataSize; i += 64) {
for (auto i = 0; i < dataSize; i += 64) {
_mm_clflush((void*)&data[i]);
}
}
Expand All @@ -49,8 +49,16 @@ int parseArgumentInt(
int non_exist_val,
int def_val);
bool parseArgumentBool(
int argc, const char* argv[], const char* arg, bool def_val);
int argc,
const char* argv[],
const char* arg,
bool def_val);

namespace {
struct empty_flush {
void operator()() const {}
};
} // namespace
/**
* @param Fn functor to execute
* @param Fe data eviction functor
Expand All @@ -60,7 +68,7 @@ double measureWithWarmup(
Fn&& fn,
int warmupIterations,
int measuredIterations,
Fe&& fe = [] () {},
const Fe& fe = empty_flush(),
bool useOpenMP = false) {
for (int i = 0; i < warmupIterations; ++i) {
// Evict data first
Expand Down

0 comments on commit c31324f

Please sign in to comment.