-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- first compiling version of OCL streaming with demo application git-svn-id: https://ipvs.informatik.uni-stuttgart.de/SGpp/repos/branches/SGppAutoTune@4220 4eea3252-f0fb-4393-894d-40516dce545b
- Loading branch information
Showing
263 changed files
with
5,939 additions
and
2,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// Copyright (C) 2008-today The SG++ project | ||
// This file is part of the SG++ project. For conditions of distribution and | ||
// use, please see the copyright notice provided with SG++ or at | ||
// sgpp.sparsegrids.org | ||
|
||
%include "std_string.i" | ||
|
||
%newobject SGPP::base::Grid::createLinearGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearStretchedGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearBoundaryGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearClenshawCurtisGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearTruncatedBoundaryGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearTruncatedBoundaryGrid(SGPP::base::BoudingBox& BB); | ||
%newobject SGPP::base::Grid::createLinearStretchedTruncatedBoundaryGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createLinearStretchedTruncatedBoundaryGrid(SGPP::base::Stretching& BB); | ||
%newobject SGPP::base::Grid::createModLinearGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createPolyGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createModPolyGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createWaveletGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createWaveletTruncatedBoundaryGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createModWaveletGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createBsplineGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createBsplineTruncatedBoundaryGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createBsplineClenshawCurtisGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createModBsplineGrid(size_t dim, size_t degree); | ||
%newobject SGPP::base::Grid::createLinearGeneralizedTruncatedBoundaryGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createSquareRootGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createPrewaveletGrid(size_t dim); | ||
%newobject SGPP::base::Grid::createPeriodicGrid(size_t dim); | ||
|
||
%newobject SGPP::base::Grid::unserialize(std::string& istr); | ||
|
||
%newobject SGPP::base::Grid::createGridGenerator(); | ||
|
||
%include "stl.i" | ||
%include "typemaps.i" | ||
|
||
//%apply std::string *OUTPUT { std::string& ostr }; | ||
//%apply std::string *INPUT { std::string& istr }; | ||
|
||
|
||
using namespace SGPP; | ||
namespace SGPP | ||
{ | ||
namespace base | ||
{ | ||
|
||
class Grid | ||
{ | ||
public: | ||
static Grid* createLinearGrid(size_t dim); | ||
static Grid* createLinearStretchedGrid(size_t dim); | ||
static Grid* createLinearBoundaryGrid(size_t dim); | ||
static Grid* createLinearClenshawCurtisGrid(size_t dim); | ||
static Grid* createLinearTruncatedBoundaryGrid(size_t dim); | ||
static Grid* createLinearStretchedTruncatedBoundaryGrid(size_t dim); | ||
static Grid* createModLinearGrid(size_t dim); | ||
static Grid* createPolyGrid(size_t dim, size_t degree); | ||
static Grid* createModPolyGrid(size_t dim, size_t degree); | ||
static Grid* createWaveletGrid(size_t dim); | ||
static Grid* createWaveletTruncatedBoundaryGrid(size_t dim); | ||
static Grid* createModWaveletGrid(size_t dim); | ||
static Grid* createBsplineGrid(size_t dim, size_t degree); | ||
static Grid* createBsplineTruncatedBoundaryGrid(size_t dim, size_t degree); | ||
static Grid* createBsplineClenshawCurtisGrid(size_t dim, size_t degree); | ||
static Grid* createModBsplineGrid(size_t dim, size_t degree); | ||
static Grid* createSquareRootGrid(size_t dim); | ||
static Grid* createLinearGeneralizedTruncatedBoundaryGrid(size_t dim); | ||
static Grid* createPrewaveletGrid(size_t dim); | ||
static Grid* createLinearGridStencil(size_t dim); | ||
static Grid* createModLinearGridStencil(size_t dim); | ||
static Grid* createPeriodicGrid(size_t dim); | ||
|
||
static Grid* unserialize(std::string& istr); | ||
|
||
protected: | ||
Grid(); | ||
Grid(Grid& o); | ||
|
||
public: | ||
virtual ~Grid(); | ||
|
||
public: | ||
virtual SGPP::base::GridGenerator* createGridGenerator() = 0; | ||
virtual SGPP::base::GridStorage* getStorage(); | ||
virtual SGPP::base::BoundingBox* getBoundingBox(); | ||
virtual SGPP::base::Stretching* getStretching(); | ||
|
||
virtual const char* getType() = 0; | ||
virtual const SBasis& getBasis() = 0; | ||
virtual void serialize(std::string& ostr); | ||
void refine(SGPP::base::DataVector* vector, int num); | ||
float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point); | ||
void insertPoint(size_t dim, unsigned int levels[], unsigned int indeces[], bool isLeaf); | ||
int getSize(); | ||
}; | ||
} | ||
} | ||
|
||
//these are just two new interfaces for consistency with Memento design pattern | ||
%extend SGPP::base::Grid{ | ||
SGPP::base::Grid* createMemento(){ | ||
return $self; | ||
} | ||
|
||
static SGPP::base::Grid* setMemento(std::string& istr){ | ||
return SGPP::base::Grid::unserialize(istr); | ||
} | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
// Copyright (C) 2008-today The SG++ project | ||
// This file is part of the SG++ project. For conditions of distribution and | ||
// use, please see the copyright notice provided with SG++ or at | ||
// sgpp.sparsegrids.org | ||
|
||
namespace SGPP | ||
{ | ||
namespace base | ||
{ | ||
|
||
class RefinementFunctor | ||
{ | ||
public: | ||
typedef float_t value_type; | ||
|
||
virtual float_t operator()(SGPP::base::GridStorage* storage, size_t seq) = 0; | ||
virtual float_t start() = 0; | ||
}; | ||
|
||
class CoarseningFunctor | ||
{ | ||
public: | ||
typedef float_t value_type; | ||
|
||
virtual float_t operator()(SGPP::base::GridStorage* storage, size_t seq) = 0; | ||
virtual float_t start() = 0; | ||
}; | ||
|
||
class GridGenerator | ||
{ | ||
public: | ||
virtual void regular(size_t level) = 0; | ||
virtual void cliques(int level, size_t clique_size) = 0; | ||
virtual void full(size_t level) = 0; | ||
virtual void truncated(size_t level,size_t l_user) = 0; | ||
virtual void refine(SGPP::base::RefinementFunctor* func) = 0; | ||
virtual void coarsen(SGPP::base::CoarseningFunctor* func, SGPP::base::DataVector* alpha) = 0; | ||
virtual void coarsenNFirstOnly(SGPP::base::CoarseningFunctor* func, SGPP::base::DataVector* alpha, size_t numFirstOnly) = 0; | ||
virtual int getNumberOfRefinablePoints() = 0; | ||
virtual int getNumberOfRemovablePoints() = 0; | ||
virtual void refineMaxLevel(SGPP::base::RefinementFunctor* func, unsigned int maxLevel) = 0; | ||
virtual int getNumberOfRefinablePointsToMaxLevel(unsigned int maxLevel) = 0; | ||
}; | ||
|
||
class OperationMultipleEval | ||
{ | ||
public: | ||
virtual void mult(SGPP::base::DataVector& alpha, SGPP::base::DataVector& result) = 0; | ||
virtual void multTranspose(SGPP::base::DataVector& soruce, SGPP::base::DataVector& result) = 0; | ||
}; | ||
|
||
class OperationMatrix | ||
{ | ||
public: | ||
virtual void mult(SGPP::base::DataVector& alpha, SGPP::base::DataVector& result) = 0; | ||
};*/ | ||
/* | ||
class OperationConvert | ||
{ | ||
public: | ||
virtual void doConvertToLinear(SGPP::base::DataVector& alpha) = 0; | ||
virtual void doConvertFromLinear(SGPP::base::DataVector& alpha) = 0; | ||
}; | ||
class OperationEval | ||
{ | ||
public: | ||
virtual float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point) = 0; | ||
}; | ||
class OperationNaiveEval | ||
{ | ||
public: | ||
virtual float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point) = 0; | ||
}; | ||
class OperationNaiveEvalGradient | ||
{ | ||
public: | ||
virtual float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point, SGPP::base::DataVector& gradient) = 0; | ||
}; | ||
class OperationNaiveEvalHessian | ||
{ | ||
public: | ||
virtual float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point, SGPP::base::DataVector& gradient, SGPP::base::DataMatrix& hessian) = 0; | ||
}; | ||
class OperationNaiveEvalPartialDerivative | ||
{ | ||
public: | ||
virtual float_t eval(SGPP::base::DataVector& alpha, SGPP::base::DataVector& point, size_t deriv_dim) = 0; | ||
}; | ||
class OperationHierarchisation | ||
{ | ||
public: | ||
virtual void doHierarchisation(SGPP::base::DataVector& node_values) = 0; | ||
virtual void doDehierarchisation(SGPP::base::DataVector& alpha) = 0; | ||
}; | ||
class OperationQuadrature | ||
{ | ||
public: | ||
virtual float_t doQuadrature(SGPP::base::DataVector& alpha) = 0; | ||
}; | ||
} | ||
//- namespace parallel -------------------------------------------- | ||
/*namespace parallel { | ||
class OperationMultipleEvalVectorized | ||
{ | ||
public: | ||
virtual double multVectorized(sg::base::DataVector& alpha, sg::base::DataVector& result) = 0; | ||
virtual double multTransposeVectorized(sg::base::DataVector& source, sg::base::DataVector& result) = 0; | ||
virtual void rebuildLevelAndIndex() = 0; | ||
}; | ||
}*/ | ||
//- end namespace parallel -------------------------------------------- | ||
|
||
} |
Oops, something went wrong.