This repository has been archived by the owner on Aug 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 432
Home
Tianqi Chen edited this page Mar 27, 2014
·
26 revisions
This is the documentation for mshadow: A Lightweight CPU/GPU Matrix/Tensor Template Library in C++/CUDA.
- Read Tutorial to get started, understand data structures, and basic usages.
- [Expression API](Expression API) gives a comprehensive list of expressions supported in mshadow
- Read rest part of this page for other information.
- Basically, all the files ends in
-inl.hpp, -inl.cuh
are implementations, and can be ignored if only using mshadow - The files ends in
.h
are heavily commented with doxyen format, and can be used to generate the corresponding document - List of useful headers that needed to be included independently, read comments directly, or doxygen generated documents, an online version of doxygen generated documents is Here
- mashadow/tensor.h: core header, contains all data structure, and core functions
- mashadow/tensor_random.h: random number generator
- mashadow/tensor_io.h: utils for save write to binary file
- mashadow/tensor_container.h: an potential useful implementation that handles memory allocation like STL
- Doxygen works well for normal APIs header listed above, except for expression related codes. They also comes with detail comments, but maybe not straight forward to understand, read [Expression API](Expression API) for documentation of expression.
- mashadow/tensor_expr.h: definition of expression template
- mashadow/tensor_expr_ext.h: extension of expressions
- Use mshadow: mshadow is a purely template library, include
#include "mshadow/tensor.h"
to your code to use the lib - Package dependency: mshadow will need MKL or other CBLAS to do matrix multiplication. The package dependencies can be customized via macros in mashadow/tensor_base.h, examples:
- To compile with CBLAS(ATLAS), add -DMSHADOW_USE_MKL=0 -DMSHADOW_USE_CBLAS=0 to CFLAGS
- To compile without CUDA, and only use cpu mode, add -DMSHADOW_USE_CUDA=0 to CFLAGS