diff --git a/docs/Doxyfile b/docs/Doxyfile index 1e208e6..dbd5463 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -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 diff --git a/docs/source/conf.py b/docs/source/conf.py index d28509a..7d56fd7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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'] diff --git a/docs/source/core.rst b/docs/source/core.rst index 0ef435b..8d34452 100644 --- a/docs/source/core.rst +++ b/docs/source/core.rst @@ -42,6 +42,7 @@ Host-Device Automation Compilation Options ------------------- .. doxygendefine:: CUDATOOLS_ARRAY_MAX_AXES +.. doxygendefine:: CUDATOOLS_USE_EIGEN Macro Functions =============== diff --git a/include/Array.h b/include/Array.h index 3772a8d..cd6e646 100644 --- a/include/Array.h +++ b/include/Array.h @@ -4,7 +4,7 @@ #include "Core.h" #include "Macros.h" #include "Types.h" -#include + #include #include #include @@ -12,6 +12,10 @@ #include #include +#ifdef CUDATOOLS_USE_EIGEN +#include +#endif + #ifdef DEVICE #define POINTER pDevice #else @@ -22,6 +26,7 @@ using namespace CudaTools::Types; namespace CudaTools { +#ifdef CUDATOOLS_USE_EIGEN template using EigenMat = Eigen::Matrix; template using EigenMapMat = Eigen::Map>; @@ -30,6 +35,7 @@ template using ConstEigenMapMat = Eigen::Map>; template struct EigenAdaptConst_S { typedef EigenMapMat type; }; template struct EigenAdaptConst_S { typedef ConstEigenMapMat type; }; template using EigenAdaptConst = typename EigenAdaptConst_S::type; +#endif template class Array; @@ -496,6 +502,7 @@ template class Array { */ HD void flatten() { reshape({mShape.mItems}); }; +#ifdef CUDATOOLS_USE_EIGEN /** * Returns the Eigen::Map of this Array. */ @@ -507,6 +514,7 @@ template class Array { return EigenAdaptConst>((ComplexConversion*)POINTER, mShape.rows(), mShape.cols()); }; +#endif /** * Gets the Shape of the Array. diff --git a/include/BLAS.h b/include/BLAS.h index e315b2a..f25742b 100644 --- a/include/BLAS.h +++ b/include/BLAS.h @@ -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" diff --git a/include/Macros.h b/include/Macros.h index ff826e7..1b6f08d 100644 --- a/include/Macros.h +++ b/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.