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

CUDA warning #20013-D when there is not the flag --expt-relaxed-constexpr #1777

Open
xq114 opened this issue Feb 8, 2025 · 1 comment
Open
Labels
1:ST:low-importance This issue/PR is not that important and can be ignored for now. is:bug Something looks wrong. reg:build This is related to the build system.

Comments

@xq114
Copy link

xq114 commented Feb 8, 2025

When I try to include ginkgo in my CUDA .cu source files, I get the warning from the compiler:

include\ginkgo/core/preconditioner/jacobi.hpp(71): warning #20013-D: calling a constexpr __host__ function("one") from a __host__ __device__ function("get_group_size") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
          return one<IndexType>() << group_power;
                 ^
          detected during:
            instantiation of "IndexType gko::preconditioner::block_interleaved_storage_scheme<IndexType>::get_group_size() const noexcept 
[with IndexType=vl::idx_t]" at line 91
            instantiation of "gko::size_type gko::preconditioner::block_interleaved_storage_scheme<IndexType>::compute_storage_space(gko::size_type) const noexcept [with IndexType=vl::idx_t]" at line 557
            instantiation of "gko::preconditioner::Jacobi<ValueType, IndexType>::Jacobi(const gko::preconditioner::Jacobi<ValueType, IndexType>::Factory *, std::shared_ptr<const gko::LinOp>) [with ValueType=float, IndexType=vl::idx_t]" at line 188 of include\ginkgo/core/base/abstract_factory.hpp
            instantiation of "std::unique_ptr<gko::EnableDefaultFactory<ConcreteFactory, ProductType, ParametersType, PolymorphicBase>::abstract_product_type, std::default_delete<gko::EnableDefaultFactory<ConcreteFactory, ProductType, ParametersType, PolymorphicBase>::abstract_product_type>> gko::EnableDefaultFactory<ConcreteFactory, ProductType, ParametersType, PolymorphicBase>::generate_impl(gko::EnableDefaultFactory<ConcreteFactory, ProductType, ParametersType, PolymorphicBase>::components_type) const [with ConcreteFactory=gko::preconditioner::Jacobi<float, vl::idx_t>::Factory, ProductType=gko::preconditioner::Jacobi<float, vl::idx_t>, ParametersType=gko::preconditioner::Jacobi<float, vl::idx_t>::parameters_type, PolymorphicBase=gko::LinOpFactory]" at line 501

It seems one is not marked __host__ __device__ or GKO_ATTRIBUTE.

System Info: Windows 10, CUDA 12.5, MSVC 17.12.4

@MarcelKoch MarcelKoch added is:bug Something looks wrong. reg:build This is related to the build system. 1:ST:low-importance This issue/PR is not that important and can be ignored for now. labels Feb 10, 2025
@MarcelKoch
Copy link
Member

The issue is caused by some inconsistencies on how we define device callable functions. I think it's safe to ignore the warning, until we will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1:ST:low-importance This issue/PR is not that important and can be ignored for now. is:bug Something looks wrong. reg:build This is related to the build system.
Projects
None yet
Development

No branches or pull requests

2 participants