Added Eigen compilation option

main
Kenneth Jao 2 years ago
parent 3963e70391
commit be5d816140
  1. 2
      docs/Doxyfile
  2. 4
      docs/source/conf.py
  3. 1
      docs/source/core.rst
  4. 10
      include/Array.h
  5. 4
      include/BLAS.h
  6. 6
      include/Macros.h

@ -829,7 +829,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = "./"
INPUT = "./include"
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

@ -27,8 +27,8 @@ extensions = [
'breathe',
]
breathe_projects = {"DGEMS": "../build/xml"}
breathe_default_project = "DGEMS"
breathe_projects = {"CudaTools": "../build/xml"}
breathe_default_project = "CudaTools"
bibtex_bibfiles = ['refs.bib']

@ -42,6 +42,7 @@ Host-Device Automation
Compilation Options
-------------------
.. doxygendefine:: CUDATOOLS_ARRAY_MAX_AXES
.. doxygendefine:: CUDATOOLS_USE_EIGEN
Macro Functions
===============

@ -4,7 +4,7 @@
#include "Core.h"
#include "Macros.h"
#include "Types.h"
#include <Eigen/Dense>
#include <cmath>
#include <complex>
#include <cstdlib>
@ -12,6 +12,10 @@
#include <random>
#include <type_traits>
#ifdef CUDATOOLS_USE_EIGEN
#include <Eigen/Dense>
#endif
#ifdef DEVICE
#define POINTER pDevice
#else
@ -22,6 +26,7 @@ using namespace CudaTools::Types;
namespace CudaTools {
#ifdef CUDATOOLS_USE_EIGEN
template <typename T>
using EigenMat = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>;
template <typename T> using EigenMapMat = Eigen::Map<EigenMat<T>>;
@ -30,6 +35,7 @@ template <typename T> using ConstEigenMapMat = Eigen::Map<const EigenMat<T>>;
template <typename T> struct EigenAdaptConst_S { typedef EigenMapMat<T> type; };
template <typename T> struct EigenAdaptConst_S<const T> { typedef ConstEigenMapMat<T> type; };
template <typename T> using EigenAdaptConst = typename EigenAdaptConst_S<T>::type;
#endif
template <typename T> class Array;
@ -496,6 +502,7 @@ template <typename T> class Array {
*/
HD void flatten() { reshape({mShape.mItems}); };
#ifdef CUDATOOLS_USE_EIGEN
/**
* Returns the Eigen::Map of this Array.
*/
@ -507,6 +514,7 @@ template <typename T> class Array {
return EigenAdaptConst<ComplexConversion<T>>((ComplexConversion<T>*)POINTER, mShape.rows(),
mShape.cols());
};
#endif
/**
* Gets the Shape of the Array.

@ -1,6 +1,10 @@
#ifndef CUDATOOLS_BLAS_H
#define CUDATOOLS_BLAS_H
#ifndef CUDATOOLS_USE_EIGEN
#error "Cannot use CudaTools BLAS.h header without Eigen."
#endif
#include "Array.h"
#include "Core.h"
#include "Macros.h"

@ -49,6 +49,12 @@
*/
#define SHARED
/**
* \def CUDATOOLS_USE_EIGEN
* Compile the CudaTools library with Eigen support.
*/
#define CUDATOOLS_USE_EIGEN
/**
* \def KERNEL(call, settings, ...)
* Used to call a CUDA kernel.

Loading…
Cancel
Save