SWDEV-269879 - Adding function that recommends optimal thread count

Change-Id: I42eb94a058c1b7f9253182e16ff1c3389a836d61
Цей коміт міститься в:
cjatin
2021-01-18 15:04:11 +05:30
зафіксовано Jatin Chaudhary
джерело a12163b4e5
коміт 7ba1a0cf72
7 змінених файлів з 69 додано та 11 видалено
+6 -1
Переглянути файл
@@ -142,7 +142,12 @@ void run_multi_threads(uint32_t n, const std::vector<char>& buffer) {
int main() {
HIPCHECK(hipInit(0));
auto buffer = load_file();
run_multi_threads(min(THREADS * std::thread::hardware_concurrency(), MAX_THREADS), buffer);
auto file_size = buffer.size() / (1024 * 1024);
auto thread_count = getHostThreadCount(file_size + 10);
if(thread_count == 0) {
failed("Thread Count is zero");
}
run_multi_threads(thread_count, buffer);
passed();
}
+1 -1
Переглянути файл
@@ -131,7 +131,7 @@ void run_multi_threads(uint32_t n, const std::vector<char>& buffer) {
int main() {
HIPCHECK(hipInit(0));
auto buffer = load_file();
run_multi_threads(min(THREADS * std::thread::hardware_concurrency(), MAX_THREADS), buffer);
run_multi_threads(getThreadCount(), buffer);
passed();
}