mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Move HIP/CUDA defines to Core.
This commit is contained in:
parent
26616fe5b8
commit
7c636dd5db
@ -8,7 +8,7 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
|
||||
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CORE_GPU_HIP_CUDA_DEFINES_H)
|
||||
#define EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||
|
||||
// Note that we are using EIGEN_USE_HIP here instead of EIGEN_HIPCC...this is by design
|
||||
@ -98,4 +98,4 @@
|
||||
|
||||
#endif // gpu_assert
|
||||
|
||||
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||
#endif // EIGEN_CORE_GPU_HIP_CUDA_DEFINES_H
|
@ -8,7 +8,7 @@
|
||||
// Public License v. 2.0. If a copy of the MPL was not distributed
|
||||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#if defined(EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H)
|
||||
#if defined(EIGEN_CORE_GPU_HIP_CUDA_DEFINES_H)
|
||||
|
||||
#ifndef EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
|
||||
|
||||
@ -40,6 +40,6 @@
|
||||
|
||||
#endif // EIGEN_PERMANENTLY_ENABLE_GPU_HIP_CUDA_DEFINES
|
||||
|
||||
#undef EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||
#undef EIGEN_CORE_GPU_HIP_CUDA_DEFINES_H
|
||||
|
||||
#endif // EIGEN_CXX11_TENSOR_GPU_HIP_CUDA_DEFINES_H
|
||||
#endif // EIGEN_CORE_GPU_HIP_CUDA_DEFINES_H
|
@ -4,7 +4,7 @@
|
||||
#include <Eigen/Core>
|
||||
|
||||
// Allow gpu** macros for generic tests.
|
||||
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
#include <Eigen/src/Core/util/GpuHipCudaDefines.inc>
|
||||
|
||||
// std::tuple cannot be used on device, and there is a bug in cuda < 9.2 that
|
||||
// doesn't allow std::tuple to compile for host code either. In these cases,
|
||||
|
@ -10,14 +10,11 @@
|
||||
#if defined(EIGEN_USE_GPU) && !defined(EIGEN_CXX11_TENSOR_TENSOR_DEVICE_GPU_H)
|
||||
#define EIGEN_CXX11_TENSOR_TENSOR_DEVICE_GPU_H
|
||||
|
||||
// This header file container defines fo gpu* macros which will resolve to
|
||||
// their equivalent hip* or cuda* versions depending on the compiler in use
|
||||
// A separate header (included at the end of this file) will undefine all
|
||||
#include "TensorGpuHipCudaDefines.h"
|
||||
|
||||
// IWYU pragma: private
|
||||
#include "./InternalHeaderCheck.h"
|
||||
|
||||
#include "../../../../../Eigen/src/Core/util/GpuHipCudaDefines.inc"
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
static const int kGpuScratchSize = 1024;
|
||||
@ -390,6 +387,6 @@ static EIGEN_DEVICE_FUNC inline void setGpuSharedMemConfig(gpuSharedMemConfig co
|
||||
} // end namespace Eigen
|
||||
|
||||
// undefine all the gpu* macros we defined at the beginning of the file
|
||||
#include "TensorGpuHipCudaUndefines.h"
|
||||
#include "../../../../../Eigen/src/Core/util/GpuHipCudaUndefines.inc"
|
||||
|
||||
#endif // EIGEN_CXX11_TENSOR_TENSOR_DEVICE_GPU_H
|
||||
|
@ -14,8 +14,6 @@
|
||||
#include "main.h"
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
|
||||
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
using Eigen::Tensor;
|
||||
|
||||
template <int Layout>
|
||||
|
@ -17,8 +17,6 @@
|
||||
#include "main.h"
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
|
||||
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
using Eigen::Tensor;
|
||||
typedef Tensor<float, 1>::DimensionPair DimPair;
|
||||
|
||||
|
@ -17,8 +17,6 @@
|
||||
#include "OffByOneScalar.h"
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
|
||||
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
using Eigen::RowMajor;
|
||||
using Eigen::Tensor;
|
||||
|
||||
|
@ -15,8 +15,6 @@
|
||||
#include "main.h"
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
|
||||
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
using Eigen::Tensor;
|
||||
|
||||
void test_gpu_nullary() {
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include "main.h"
|
||||
#include <Eigen/CXX11/Tensor>
|
||||
|
||||
#include <Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
void test_gpu_random_uniform() {
|
||||
Tensor<float, 2> out(72, 97);
|
||||
out.setZero();
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include "main.h"
|
||||
#include <unsupported/Eigen/CXX11/Tensor>
|
||||
|
||||
#include <Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
|
||||
|
||||
using Eigen::Tensor;
|
||||
typedef Tensor<float, 1>::DimensionPair DimPair;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user