integrating memory_validation bench in cmake build

Change-Id: I90ad85c7b1517c162804a00d5abb75007bf831fe


[ROCm/rocprofiler commit: 6c5ca62575]
This commit is contained in:
Evgeny committed 2019-07-23 11:14:44 -05:00
1 vanhempi 283347f22a
commit 8b16b3b733
4 files changed
+31 -3

No files matched your search

@@ -73,7 +73,28 @@ class ContextPool {
void Flush() {
check_completed();
}
#if 0
template <class F>
F for_each(const F& f_p) {
F f = f_p;
while (sync_flag_.test_and_set(std::memory_order_acquire) != false) {
std::this_thread::yield();
}
index_t read_index = read_index_.load(std::memory_order_relaxed);
const index_t write_index = write_index_.load(std::memory_order_relaxed);
while(read_index < write_index) {
rocprofiler_pool_entry_t pool_entry{};
entry_t* entry = GetPoolEntry(read_index, &pool_entry);
const bool completed = entry->completed.load(std::memory_order_acquire);
if (completed == false) {
f(entry->context, entry->payload);
}
}
return f;
}
#endif
private:
static unsigned aligned64(const unsigned& size) { return (size + 0x3f) & ~0x3fu; }