Jump to content
  • Advertisement
Sign in to follow this  
maxest

[CUDA] Calling a host function from within the device

This topic is 2393 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Exactly one year ago I used the current at the time CUDA version (don't remember which one) and I wrote some CUDA kernels that made use of my vector class. This class has some functions, mostly overloaded operators. And they all worked fine. But today I downloaded that newest CUDA toolkit, try to compile my old project and...

error: calling a host function("vec3::operator +") from a __device__/__global__ function("rasterizePixel") is not allowed

Is there a way to fix that? And I would prefer a way that avoids any modifications to vec3 class.

Share this post


Link to post
Share on other sites
Advertisement
Then I don't know how it ever worked. The model is that the host sends work to the device, but not the other way around. The device can only call functions that can run on the device.

Share this post


Link to post
Share on other sites
I'm aware of that, but why CUDA compiler isn't smart enough to convert those functions to CUDA version? I thought the previous compiler did that

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!