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

Narrowing conversion in Ginko #655

Closed
nychiang opened this issue Aug 24, 2023 · 7 comments
Closed

Narrowing conversion in Ginko #655

nychiang opened this issue Aug 24, 2023 · 7 comments

Comments

@nychiang
Copy link
Collaborator

nychiang commented Aug 24, 2023

Using C++17 and compiler flags "-Wall -Werror, I got the following error on PNNL CI:

/src/LinAlg/hiopLinSolverSparseGinkgo.cpp:178:89: error: narrowing conversion of 'n_' from 'int' to 'gko::dim<2>::dimension_type' {aka 'long unsigned int'} inside { } [-Werror=narrowing]
     auto mtx = gko::share(gko::matrix::Csr<double, int>::create(exec, gko::dim<2>{n_, n_}, val_array, col_idxs, row_ptrs));

It seems to me Ginkgo use long unsigned int inside function gko::dim.

For more details, see #653 #654

@pelesh @tepperly @cnpetra

@pelesh
Copy link
Collaborator

pelesh commented Aug 24, 2023

Does explicitly casting n_ to unsigned integer before passing it to Ginkgo resolves the issue?

@nychiang
Copy link
Collaborator Author

Yes, manually casting those variables work fine. Now everything works on Newell.
However, on Marianas, I got the following error from different places :

people/svcexasgd/gitlab/126079/src/LinAlg/hiopLinSolverSparseGinkgo.cpp:175:42: error: 'using Array = class gko::array<double>' is deprecated: please use array [-Werror=deprecated-declarations]
  175 |     auto val_array = gko::Array<double>::view(exec, nnz_, kVal_);
      |                                          ^~~~
In file included from /qfs/projects/exasgd/src/ci-deception/linux-centos7-zen2/gcc-10.2.0/ginkgo-1.5.0.glu_experimental-3o5dw4rvskf3bkknmfzth252ybr4crcf/include/ginkgo/ginkgo.hpp:41,
                 from /people/svcexasgd/gitlab/126079/src/LinAlg/hiopLinSolverSparseGinkgo.hpp:55,
                 from /people/svcexasgd/gitlab/126079/src/LinAlg/hiopLinSolverSparseGinkgo.cpp:55:
/qfs/projects/exasgd/src/ci-deception/linux-centos7-zen2/gcc-10.2.0/ginkgo-1.5.0.glu_experimental-3o5dw4rvskf3bkknmfzth252ybr4crcf/include/ginkgo/core/base/array.hpp:717:7: note: declared here
  717 | using Array [[deprecated("please use array")]] = array<ValueType>;

Any suggestion?

@fritzgoebel @pelesh @cnpetra

@cnpetra
Copy link
Collaborator

cnpetra commented Sep 1, 2023

maybe avoid deprecated call?

@fritzgoebel
Copy link

I am working on updating the Ginkgo interface and will get rid of the deprecated call in the process.

@nychiang
Copy link
Collaborator Author

nychiang commented Sep 5, 2023

@fritzgoebel Thanks for taking care of this. In fact, I tried to fix it in PR #654. Right now it passes all the designed pipeline tests. Please have a look of it, as it is ready for merge.

@cnpetra

@fritzgoebel
Copy link

Sorry, I was not aware of the PR. Looks good to me.

@nychiang
Copy link
Collaborator Author

Closed by PR #654 @cnpetra

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

4 participants