mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-20 08:39:37 +08:00
Handle min/max/inf/etc issue in cuda_fp16.h directly in test/main.h
This commit is contained in:
parent
21633e585b
commit
304ef29571
@ -20,9 +20,6 @@
|
|||||||
|
|
||||||
#include <math_constants.h>
|
#include <math_constants.h>
|
||||||
#include <cuda.h>
|
#include <cuda.h>
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "cuda_common.h"
|
#include "cuda_common.h"
|
||||||
|
|
||||||
|
13
test/main.h
13
test/main.h
@ -50,6 +50,19 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Same for cuda_fp16.h
|
||||||
|
#if defined(__CUDACC_VER_MAJOR__) && (__CUDACC_VER_MAJOR__ >= 9)
|
||||||
|
#define EIGEN_TEST_CUDACC_VER ((__CUDACC_VER_MAJOR__ * 10000) + (__CUDACC_VER_MINOR__ * 100))
|
||||||
|
#elif defined(__CUDACC_VER__)
|
||||||
|
#define EIGEN_TEST_CUDACC_VER __CUDACC_VER__
|
||||||
|
#else
|
||||||
|
#define EIGEN_TEST_CUDACC_VER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if EIGEN_TEST_CUDACC_VER >= 70500
|
||||||
|
#include <cuda_fp16.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// To test that all calls from Eigen code to std::min() and std::max() are
|
// To test that all calls from Eigen code to std::min() and std::max() are
|
||||||
// protected by parenthesis against macro expansion, the min()/max() macros
|
// protected by parenthesis against macro expansion, the min()/max() macros
|
||||||
// are defined here and any not-parenthesized min/max call will cause a
|
// are defined here and any not-parenthesized min/max call will cause a
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
#define EIGEN_TEST_FUNC cxx11_tensor_cuda
|
#define EIGEN_TEST_FUNC cxx11_tensor_cuda
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
#define EIGEN_TEST_FUNC cxx11_tensor_complex
|
#define EIGEN_TEST_FUNC cxx11_tensor_complex
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
#define EIGEN_TEST_FUNC cxx11_tensor_complex_cwise_ops
|
#define EIGEN_TEST_FUNC cxx11_tensor_complex_cwise_ops
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -14,9 +14,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
#define EIGEN_TEST_FUNC cxx11_tensor_cuda
|
#define EIGEN_TEST_FUNC cxx11_tensor_cuda
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <Eigen/CXX11/Tensor>
|
#include <Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
#define EIGEN_TEST_FUNC cxx11_tensor_reduction_cuda
|
#define EIGEN_TEST_FUNC cxx11_tensor_reduction_cuda
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if dEIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
#define EIGEN_DEFAULT_DENSE_INDEX_TYPE int
|
||||||
#define EIGEN_USE_GPU
|
#define EIGEN_USE_GPU
|
||||||
|
|
||||||
#if EIGEN_CUDACC_VER >= 70500
|
|
||||||
#include <cuda_fp16.h>
|
|
||||||
#endif
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <unsupported/Eigen/CXX11/Tensor>
|
#include <unsupported/Eigen/CXX11/Tensor>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user