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

Use cuda_add_library and cuda_add_executable if cuda is found #576

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jjcasmar
Copy link

No description provided.

@hernando
Copy link

It looks this will work for your case but could have undesired side effects in the general case. In particular, in complex projects that have multiple targets, you don't want to use cuda_add_foo for those ones that don't have a direct dependency on CUDA. Can you confirm what happens if you add common_find_package(CUDA) to a project that actually doesn't use it?

@jjcasmar
Copy link
Author

You are absolutely right. For a particular target that doesn't need CUDA, cuda_add_foo would still be called, which may be undesirable. Maybe we can activate cuda calls by setting a flag for the target set(TARGET_USE_CUDA).

I have test this with a project which has some targets needing CUDA and some targets that don't and it works fine anyway, but, of course, its not perfect.

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.

2 participants