Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CUDA host/device calling #276

Closed
hrehfeld opened this issue Nov 24, 2014 · 6 comments
Closed

CUDA host/device calling #276

hrehfeld opened this issue Nov 24, 2014 · 6 comments
Assignees
Labels
Milestone

Comments

@hrehfeld
Copy link

glm\glm\detail\func_integer.inl(202): warning : calling a __host__ function from a __host__ __device__ function is not allowed
@Groovounet
Copy link
Member

What version?

On master, line 202 is in the middle of nowhere.

@hrehfeld
Copy link
Author

I pulled yesterday:

ext\glm\glm\detail>git rev-parse HEAD
e8fbcf76ddcee6862165a37b602df4aabbba5f63

GLM_FUNC_QUALIFIER uint uaddCarry(uint const & x, uint const & y, uint & Carry)
{
    uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
    uint64 const Max32(static_cast<uint64>(std::numeric_limits<uint>::max())); //here
    Carry = Value64 > Max32 ? 1 : 0;
    return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
}

@Groovounet
Copy link
Member

It looks like that CUDA doesn't fully support std::numeric_limits. :/

@Groovounet Groovounet reopened this Nov 29, 2014
Groovounet pushed a commit that referenced this issue Nov 29, 2014
@ChRis6
Copy link

ChRis6 commented Dec 1, 2014

on 0.9.6.0 I'm getting:
glm/detail/func_integer.inl(206): warning: calling a constexpr host function("max") from a host device function("uaddCarry") is not allowed

and it gives seg fault.It was fine on 0.9.5.4

@Groovounet Groovounet added the bug label Dec 1, 2014
@Groovounet Groovounet added this to the GLM 0.9.6 milestone Dec 1, 2014
@Groovounet Groovounet self-assigned this Dec 1, 2014
@Groovounet
Copy link
Member

Ah, I have been handwavy on the previous fix. This second commit should resolve this issue.

This fix is available for in GLM 0.9.6 branch for GLM 0.9.6.1.

Thanks for contributing,
Christophe

@hrehfeld
Copy link
Author

With #499

 glm\glm\gtc\constants.inl(40): warning : calling a __host__ function from a __host__ __device__ function is not allowed

from this code:

if (idealAngle <= ::glm::epsilon<float>())

and yes, these device annotations are really annoying in CUDA, sorry :/

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants