Skip to content

CUDA compilation fails if <complex> is included #49727

Description

@llvmbot
Bugzilla Link 50383
Resolution FIXED
Resolved on Jun 01, 2021 17:33
Version 11.0
OS Linux
Reporter LLVM Bugzilla Contributor
CC @fodinabor,@rgreenblatt,@Artem-B,@jwakely
Fixed by commit(s) 9a75c06

Extended Description

The file: "/usr/include/c++/11.1.0/complex" contains function named "polar", which does the following test:

__glibcxx_assert( __rho >= 0 );

which breaks CUDA compilation. Commenting the above line solves the issue. The error is as follows:

error: __host__ __device__ function '__failed_assertion' cannot overload __host__ function '__failed_assertion'
      __glibcxx_assert( __rho >= 0 );
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:754:5: note: expanded from macro '__glibcxx_assert'
    __glibcxx_assert_1(_Condition)        \
    ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:743:13: note: expanded from macro '__glibcxx_assert_1'
       void __failed_assertion();       \
            ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/bits/atomic_base.h:266:7: note: previous declaration is here
      __glibcxx_assert(__b != memory_order_consume);
      ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:754:5: note: expanded from macro '__glibcxx_assert'
    __glibcxx_assert_1(_Condition)        \
    ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:743:13: note: expanded from macro '__glibcxx_assert_1'
       void __failed_assertion();       \
            ^

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillacuda

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions