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

[tests][cmake] an update of ONEDPL_BACKEND variable description #1953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MikeDvorskiy
Copy link
Contributor

[tests][cmake] an update of ONEDPL_BACKEND variable description.

@@ -8,7 +8,7 @@ The following variables are provided for oneDPL configuration:

| Variable | Type | Description | Default value |
|------------------------------|--------|-----------------------------------------------------------------------------------------------|---------------|
| ONEDPL_BACKEND | STRING | Threading backend; supported values: tbb, dpcpp, dpcpp_only, serial, ...; the default value is defined by compiler: dpcpp for DPC++ and tbb for others | tbb/dpcpp |
| ONEDPL_BACKEND | STRING | Threading backend; supported values: tbb, dpcpp, dpcpp_only, tbb, omp, serial, ...; the default value is defined by compiler: dpcpp for DPC++ and tbb for others. These values may conflict with explicit set variables like `-DCMAKE_CXX_FLAGS="-DONEDPL_USE_DPCPP_BACKEND=0"` etc. | tbb/dpcpp |
Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| ONEDPL_BACKEND | STRING | Threading backend; supported values: tbb, dpcpp, dpcpp_only, tbb, omp, serial, ...; the default value is defined by compiler: dpcpp for DPC++ and tbb for others. These values may conflict with explicit set variables like `-DCMAKE_CXX_FLAGS="-DONEDPL_USE_DPCPP_BACKEND=0"` etc. | tbb/dpcpp |
| ONEDPL_BACKEND | STRING | Threading backend; supported values: `dpcpp`, `dpcpp_only`, `tbb`, `omp`, `serial`. The default value is `dpcpp` if SYCL support can be detected and `tbb` otherwise. Avoid defining backend control macros (`ONEDPL_USE_TBB_BACKEND`, `ONEDPL_USE_OPENMP_BACKEND`, `ONEDPL_USE_DPCPP_BACKEND`) directly, as they may conflict with the `ONEDPL_BACKEND` setting. | tbb/dpcpp |

Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion above also replaces

the default value is defined by compiler: dpcpp for DPC++ and tbb for others.

with

The default value is dpcpp if SYCL support can be detected and tbb otherwise.

It aligns the note with the relevant behaviour.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid defining backend control macros (ONEDPL_USE_TBB_BACKEND, ONEDPL_USE_OPENMP_BACKEND, ONEDPL_USE_DPCPP_BACKEND) directly

Would not it be better to describe what takes precedence in this case? Or is it not deterministic?

Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is deterministic. See the mapping table below.

ONEDPL_BACKEND cmake option oneDPL backend macro
dpcpp (default if SYCL is available) -
dpcpp_only ONEDPL_USE_TBB_BACKEND=0
tbb (default if SYCL is not available) ONEDPL_USE_DPCPP_BACKEND=0
omp ONEDPL_USE_DPCPP_BACKEND=0; ONEDPL_USE_OPENMP_BACKEND=1; ONEDPL_USE_TBB_BACKEND=0
serial ONEDPL_USE_DPCPP_BACKEND=0; ONEDPL_USE_OPENMP_BACKEND=0; ONEDPL_USE_TBB_BACKEND=0

I struggle to find a common logic between the options for a crisp description...


This is orthogonal to the question above, but I would prefer this set of options:

cmake flag and its options oneDPL backend macro
ONEDPL_HOST_PARALLEL_BACKEND
auto (default) (select the backend basing on the internal header heuristics)
tbb ONEDPL_USE_TBB_BACKEND=1
openmp ONEDPL_USE_OPENMP_BACKEND=1
serial ONEDPL_USE_OPENMP_BACKEND=0; ONEDPL_USE_TBB_BACKEND=0
ONEDPL_DEVICE_BACKEND
auto (default) (select the backend basing on the internal header heuristics)
dpcpp ONEDPL_USE_DPCPP_BACKEND=1
off ONEDPL_USE_DPCPP_BACKEND=0

I am going to create an issue with a feature request.

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

Successfully merging this pull request may close these issues.

3 participants