Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Conversation

@andrewcorrigan
Copy link
Contributor

I think that this should fix #845. I'm sorry for introducing this regression.

@jaredhoberock
Copy link
Contributor

Thanks, Andrew. It looks like this change rolls back that line to what it was before Artem-B's recent change to compiler.h, is that right?

@3gx
Copy link
Contributor

3gx commented Oct 24, 2016

We should revert this file to the state it had before PR #842? It appears we do not fully understand interaction of different macros, and until we do it we should revert to what used to work.

@andrewcorrigan
Copy link
Contributor Author

I didn't roll it back completely, but I think this fixes the error reported in #845 and is more correct than the check was before. Basically, the cumulative changed from before my previous PR is that this:

#if defined(__CUDA__)
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
#else
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG
#endif

which doesn't make sense but is innocuous, changes now to:

#if defined(__CUDA__) && defined(__clang__)
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG
#elif defined(__CUDA__)
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
#endif

Which is correct, but ineffective, as pointed out by Artem.

The error message reported in #845, I believe is due to my change which incorrectly made the above:

#if defined(__CUDA__) && defined(__clang__)
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG
#else
#define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
#endif

which failed to actually check for __CUDA__ before setting THRUST_DEVICE_COMPILER_NVCC.

@andrewcorrigan
Copy link
Contributor Author

@egaburov Whatever you guys prefer. I can submit a different PR with the change just rolled back.

Another option: I'd be happy to get THRUST_DEVICE_COMPILER_CLANG actually working too, and deal with all the rest of the code that only allows for THRUST_DEVICE_COMPILER_NVCC.

@andrewcorrigan andrewcorrigan mentioned this pull request Oct 24, 2016
@jaredhoberock
Copy link
Contributor

Agreed with @egaburov - let's roll it back to the state it was before and then try to fix the issue separately.

@andrewcorrigan
Copy link
Contributor Author

Please see #853.

@andrewcorrigan andrewcorrigan deleted the fix_842 branch October 29, 2016 11:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile error: unknown type name '__host__' from clang++

3 participants