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

Impossible to test API/ABI version from kernel code #565

Closed
dhdaines opened this issue Jan 17, 2018 · 5 comments
Closed

Impossible to test API/ABI version from kernel code #565

dhdaines opened this issue Jan 17, 2018 · 5 comments

Comments

@dhdaines
Copy link

Hi,

I have some kernel code that I'd like to maintain compatibility with libgpuarray 0.6 and 0.7. You would think that it would work to just put this:

#include <gpuarray/config.h>
#if GPUARRAY_API_VERSION == 2
#include <cluda.h>
#endif 

But that doesn't work! I'm just speculating here but it appears that either NVCC doesn't see the libgpuarray header files, or its preprocessor is broken and can't do #if tests.

Instead I have to test for the new-style DTYPE_INPUT_N / DTYPE_OUTPUT_N macros, which is less than ideal.

Is there any way to fix this? Is it a problem with libgpuarray or CUDA?

@nouiz
Copy link
Member

nouiz commented Jan 17, 2018 via email

@abergeron
Copy link
Member

The problem is that we use NVRTC for compilation and it doesn't see any headers that we haven't previously registered. As it's not able to find <gpuarray/config.h> that #include will not work.

If you are doing this from Theano, you can check for the theano version since Theano 0.9 == libgpuarray 0.6 and Theano 1.0 == libgpuarray 0.7.

@dhdaines
Copy link
Author

dhdaines commented Jan 23, 2018 via email

@nouiz
Copy link
Member

nouiz commented Jan 30, 2018 via email

@nouiz
Copy link
Member

nouiz commented May 11, 2018

no news in a long time, so closing.

@nouiz nouiz closed this as completed May 11, 2018
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

No branches or pull requests

3 participants