Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] Limit the number of launched threads in shift_left_right.pass with the OMP backend to avoid timeouts #1928

Merged
merged 2 commits into from
Nov 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
#include "support/sycl_alloc_utils.h"
#endif

#if ONEDPL_USE_OPENMP_BACKEND
#include <omp.h> // omp_get_max_threads, omp_set_num_threads
#endif

template<typename Name>
struct USM;

Expand Down Expand Up @@ -214,6 +218,13 @@ test_shift_by_type(Size m, Size n)
int
main()
{
#if ONEDPL_USE_OPENMP_BACKEND
// Due to small problem sizes in this test, runtime explodes on CPUs with large core counts due to
// small grain sizes per thread and cross-socket traffic.
const int max_threads = omp_get_max_threads();
const int threads_to_use = std::min(max_threads, int(32));
omp_set_num_threads(threads_to_use);
#endif
using ValueType = ::std::int32_t;

const ::std::size_t N = 100000;
Expand Down
Loading