SWDEV-269879 - Adding function that recommends optimal thread count

Change-Id: I42eb94a058c1b7f9253182e16ff1c3389a836d61
This commit is contained in:
cjatin
2021-01-18 15:04:11 +05:30
committed by Jatin Chaudhary
parent a12163b4e5
commit 7ba1a0cf72
7 changed files with 69 additions and 11 deletions
@@ -573,10 +573,13 @@ void HipMemcpyWithStreamMultiThreadtests::TestkindHtoH(void) {
void HipMemcpyWithStreamMultiThreadtests::TestwithMultiThreaded(ops op) {
int n = min(THREADS * std::thread::hardware_concurrency(), MAX_THREADS);
size_t thread_count = getHostThreadCount();
if (thread_count == 0) {
failed("Thread Count is 0");
}
std::vector<joinable_thread> threads;
for (uint32_t i = 0; i < n; i++) {
for (uint32_t i = 0; i < thread_count; i++) {
threads.emplace_back(std::thread{[&] {
switch ( op ) {
case ops::TestwithOnestream: