You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I noticed that __CUDA_ARCH__ is defined when compiling ahead of time for the HIP backend.
I don't know if this is wanted, but for example using Eigen I get an error because it tries to include CUDA libraries (the workaround here is to define EIGEN_NO_CUDA).
As an example, compiling a file that just includes the Eigen library gives this:
In file included from include_eigen.cpp:3:
In file included from eigen/Eigen/Core:160:
eigen/Eigen/src/Core/util/Meta.h:21:12: fatal error: 'math_constants.h' file not found
#include <math_constants.h>
^~~~~~~~~~~~~~~~~~
Environment (please complete the following information):
OS: Linux
Target device and vendor: AMD GPU Radeon PRO WX 9100
clang version: 16.0.0 (https://github.com/intel/llvm0f579ba)
release 2022-09 (but it tried also with the sycl-nightly/20221208 and the behaviour is the same)
The text was updated successfully, but these errors were encountered:
## Summary
The changes in these two commits, although apparently redundant, guard
SYCL compilations targeting CUDA or HIP devices by preventing the
compiler from seeing the CUDA/HIP code already in AMReX.
## Additional background
The 'vanilla' version of LLVM, which is used by hipSYCL for example,
enables `__CUDA_ARCH__` and `__HIP_DEVICE_COMPILE__` when compiling
device code, for both
[CUDA](https://llvm.org/docs/CompileCudaWithLLVM.html#detecting-clang-vs-nvcc-from-code)
and [HIP](https://reviews.llvm.org/D45441), respectively. Intel's
version of LLVM is also moving in the same direction with
[CUDA](intel/llvm#7722) and
[HIP](intel/llvm#7720), although the latter is
off to a rocky start.
Describe the bug
I noticed that
__CUDA_ARCH__
is defined when compiling ahead of time for the HIP backend.I don't know if this is wanted, but for example using Eigen I get an error because it tries to include CUDA libraries (the workaround here is to define
EIGEN_NO_CUDA
).As an example, compiling a file that just includes the Eigen library gives this:
To Reproduce
where
dummy.cpp
is justEnvironment (please complete the following information):
release 2022-09 (but it tried also with the
sycl-nightly/20221208
and the behaviour is the same)The text was updated successfully, but these errors were encountered: