mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 13:15:57 +08:00
Add ability to permanently enable HIP/CUDA gpu* defines.
When using Eigen for gpu, these simplify portability. If `EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES` is set, then we do not undefine them. (cherry picked from commit 514977f31b1c00b233969f12321a25d859dd1efa)
This commit is contained in:
parent
4b683b65df
commit
b5fc69bdd8
@ -11,6 +11,8 @@
|
|||||||
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
|
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
|
||||||
#define EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
#define EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||||
|
|
||||||
|
#ifndef EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
|
||||||
|
|
||||||
// Note that we are using EIGEN_USE_HIP here instead of EIGEN_HIPCC...this is by design
|
// Note that we are using EIGEN_USE_HIP here instead of EIGEN_HIPCC...this is by design
|
||||||
// There is code in the Tensorflow codebase that will define EIGEN_USE_GPU, but
|
// There is code in the Tensorflow codebase that will define EIGEN_USE_GPU, but
|
||||||
// for some reason gets sent to the gcc/host compiler instead of the gpu/nvcc/hipcc compiler
|
// for some reason gets sent to the gcc/host compiler instead of the gpu/nvcc/hipcc compiler
|
||||||
@ -96,4 +98,6 @@
|
|||||||
|
|
||||||
#endif // gpu_assert
|
#endif // gpu_assert
|
||||||
|
|
||||||
|
#endif // EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
|
||||||
|
|
||||||
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user