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

Force no default function when using CUDA #1107

Merged
merged 1 commit into from Oct 24, 2022
Merged

Force no default function when using CUDA #1107

merged 1 commit into from Oct 24, 2022

Conversation

stephen-hqxu
Copy link

@stephen-hqxu stephen-hqxu commented Jun 3, 2022

The compiler emits a ton of warnings when using CUDA. An snippet of the warning message looks like this:

type_vec4.hpp(101): warning : __device__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration
type_vec4.hpp(101): warning : __host__ annotation is ignored on a function("vec") that is explicitly defaulted on its first declaration

For CUDA, a trivial default function already tells both host and device compilers to emit code, therefore __device__ and __host__ qualifiers are ignored. In another word, function declared as default implies __device__ __host__ qualifier.

As a resolution, either the function qualifiers should be removed, or force to not use default function. Considering the changes made in #1106, I picked the second choice.

@christophe-lunarg
Copy link

Thanks for contributing!

@christophe-lunarg christophe-lunarg merged commit 38b7a1a into g-truc:master Oct 24, 2022
@stephen-hqxu stephen-hqxu deleted the cuda-default-function branch October 24, 2022 22:45
stephen-hqxu added a commit to stephen-hqxu/glm that referenced this pull request Mar 21, 2023
christophe-lunarg added a commit that referenced this pull request Aug 18, 2023
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.

None yet

2 participants