#include <folly/detail/CacheLocality.h>
+#include <folly/portability/GTest.h>
+
#include <sched.h>
#include <memory>
#include <thread>
#include <type_traits>
#include <unordered_map>
#include <glog/logging.h>
-#include <gtest/gtest.h>
using namespace folly::detail;
EXPECT_EQ(expected.localityIndexByCpu, parsed.localityIndexByCpu);
}
+#if FOLLY_HAVE_LINUX_VDSO
TEST(Getcpu, VdsoGetcpu) {
unsigned cpu;
Getcpu::resolveVdsoFunc()(&cpu, nullptr, nullptr);
EXPECT_TRUE(cpu < CPU_SETSIZE);
}
+#endif
#ifdef FOLLY_TLS
TEST(ThreadId, SimpleTls) {
EXPECT_EQ(cpu, again);
}
+#ifdef FOLLY_TLS
static FOLLY_TLS unsigned testingCpu = 0;
static int testingGetcpu(unsigned* cpu, unsigned* node, void* /* unused */) {
}
return 0;
}
+#endif
TEST(AccessSpreader, Simple) {
for (size_t s = 1; s < 200; ++s) {
}
}
+#ifdef FOLLY_TLS
#define DECLARE_SPREADER_TAG(tag, locality, func) \
namespace { \
template <typename dummy> \
struct tag {}; \
} \
- DECLARE_ACCESS_SPREADER_TYPE(tag) \
namespace folly { \
namespace detail { \
template <> \
}
}
}
+#endif