SWDEV-269879 - Adding function that recommends optimal thread count

Change-Id: I42eb94a058c1b7f9253182e16ff1c3389a836d61


[ROCm/hip commit: 7ba1a0cf72]
Ta zmiana jest zawarta w:
cjatin authored and Jatin Chaudhary committed 2021-02-09 13:34:08 -05:00
1 rodzic cb46badf20
złożenie e2d28dbe76
7 plików zmienionych
+69 -11

Żadne pliki nie pasują do Twojego wyszukiwania

@@ -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();
}
@@ -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();
}