aclKernelMerger.h
Go to the documentation of this file.
/*
* Advanced Simulation Library <http://asl.org.il>
*
* Copyright 2015 Avtech Scientific <http://avtechscientific.com>
*
*
* This file is part of Advanced Simulation Library (ASL).
*
* ASL is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, version 3 of the License.
*
* ASL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ASL. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef ACLKERNELMERGER_H
#define ACLKERNELMERGER_H
#include <memory>
#include <vector>
namespace acl
{
class ElementBase;
typedef std::shared_ptr<ElementBase> Element;
class Kernel;
typedef std::shared_ptr<Kernel> SPKernel;
class KernelMerger
{
private:
std::vector<SPKernel> kernels;
SPKernel kernel;
unsigned int size;
std::vector<unsigned int> offsets;
unsigned int getKernelSize(unsigned int i);
void checkKernelsCompatibility();
void computeOffsets();
Element castSpliter(unsigned int i1, unsigned int i2);
public:
KernelMerger();
void setup();
void compute();
std::string getKernelSource();
void clear();
void addKernel(SPKernel k);
void addKernel(const KernelMerger & km);
unsigned int getSize();
};
typedef std::shared_ptr<KernelMerger> SPKernelMerger;
} // namespace acl
#endif // ACLKERNELMERGER_H
acl::Kernel::SPKernelMerger
std::shared_ptr< KernelMerger > SPKernelMerger
Definition: aclKernelMerger.h:70
acl::KernelMerger
OpenCl Kernel merger.
Definition: aclKernelMerger.h:46
acl::KernelMerger::compute
void compute()
acl::KernelMerger::setup
void setup()
acl::KernelMerger::getKernelSource
std::string getKernelSource()
acl::KernelMerger::KernelMerger
KernelMerger()
acl::KernelMerger::addKernel
void addKernel(const KernelMerger &km)
acl::KernelMerger::getSize
unsigned int getSize()
acl::KernelMerger::clear
void clear()
removes all kernels
acl::KernelMerger::addKernel
void addKernel(SPKernel k)
acl
Advanced Computational Language.
Definition: acl.h:41
acl::SPKernel
std::shared_ptr< Kernel > SPKernel
Definition: aclKernelMerger.h:34
acl::Element
std::shared_ptr< ElementBase > Element
Definition: acl.h:49