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

DAAL under C++20 does not compile due to DR 2237 #2866

Open
ZijunHui opened this issue Aug 1, 2024 · 0 comments
Open

DAAL under C++20 does not compile due to DR 2237 #2866

ZijunHui opened this issue Aug 1, 2024 · 0 comments
Assignees

Comments

@ZijunHui
Copy link

ZijunHui commented Aug 1, 2024

When including the header daal.h, the program fails to compile when C++20 enabled. This is due to the inclusion of DR 2237 into the standard, which prohibits simple-template-ids in constructors. As a result, certain class constructors are malformed under C++20 and they fail to compile. At the end of the link above, a similar error case is described.

To Reproduce
Steps to reproduce the behavior:

  1. Assume the following file
#include "daal.h"
int main(){}
  1. Compile with g++ --std=c++17, observe that it compiles without errors.
  2. Compile with g++ --std=c++20, observe that multiple expected unqualified-id before ‘)’ token errors are thrown for constructors for certain classes.
In file included from /opt/intel/oneapi/dal/2024.5/include/dal/algorithms/linear_regression/linear_regression_training_distributed.h:32,
                 from /opt/intel/oneapi/dal/latest/include/daal.h:74,
                 from t.cpp:1:
/opt/intel/oneapi/dal/2024.5/include/dal/algorithms/linear_regression/linear_regression_training_types.h: At global scope:
/opt/intel/oneapi/dal/2024.5/include/dal/algorithms/linear_regression/linear_regression_training_types.h:287:35: error: expected unqualified-id before ‘)’ token
  287 |     DistributedInput<step2Master>();
      |                                   ^
In file included from /opt/intel/oneapi/dal/latest/include/daal.h:74,
                 from t.cpp:1:
/opt/intel/oneapi/dal/2024.5/include/dal/algorithms/linear_regression/linear_regression_training_distributed.h:148:54: error: expected unqualified-id before ‘)’ token
  148 |     Distributed<step1Local, algorithmFPType, method>() {}
      |                                                      ^
In file included from /opt/intel/oneapi/dal/2024.5/include/dal/algorithms/pca/pca_types.h:33,
                 from /opt/intel/oneapi/dal/latest/include/daal.h:107,
                 from t.cpp:1:
/opt/intel/oneapi/dal/2024.5/include/dal/algorithms/covariance/covariance_distributed.h:567:54: error: expected unqualified-id before ‘)’ token
  567 |     Distributed<step1Local, algorithmFPType, method>() : Online<algorithmFPType, method>() {}
      |                                                      ^
In file included from /opt/intel/oneapi/dal/latest/include/daal.h:230,
                 from t.cpp:1:
/opt/intel/oneapi/dal/2024.5/include/dal/algorithms/ridge_regression/ridge_regression_training_distributed.h:141:54: error: expected unqualified-id before ‘)’ token
  141 |     Distributed<step1Local, algorithmFPType, method>() : Online<algorithmFPType, method>() {}
      |

Expected behavior
No errors should occur. Interestingly, clang does not throw an error for this case.

Environment:

  • OS: Ubuntu 22.04
  • Compiler: g++ 11.4.0
  • Version: 2024.5
@syakov-intel syakov-intel self-assigned this Sep 23, 2024
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