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

Controlling OpenMP threads #261

Open
reguly opened this issue Feb 21, 2020 · 1 comment
Open

Controlling OpenMP threads #261

reguly opened this issue Feb 21, 2020 · 1 comment

Comments

@reguly
Copy link

reguly commented Feb 21, 2020

I compiled with clang++ and -fopenmp, yet I am having trouble controlling the number of threads. It seems triSYCL launches twice or even three times as many threads as CPU cores, which I suspect is the main reason for the poor performance of my code. changing OMP_NUM_THREADS does not seem to have any effect. Any suggestions?

@keryell
Copy link
Member

keryell commented Feb 27, 2020

If you are not using hierarchical parallelism, by default SYCL assumes that you might have some barriers in the work-group, which means, to support this with OpenMP and a plain C++ compiler, we need 1 thread per work-item... :-(

If you know that you will not be in that case, you can play with

#define TRISYCL_NO_BARRIER

like in https://github.com/triSYCL/triSYCL/blob/master/tests/parallel_for/hierarchical.cpp

See also https://github.com/triSYCL/triSYCL/blob/master/doc/macros.rst

But it might be also a bug...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants