Program Listing for File IParallelizable.h

Return to documentation for file (include/gwmodelpp/IParallelizable.h)

#ifndef IPARALLELIZABLE_H
#define IPARALLELIZABLE_H

namespace gwm
{

enum ParallelType
{
    SerialOnly = 1 << 0,
    OpenMP = 1 << 1,
    CUDA = 1 << 2
};

struct IParallelizable
{
    virtual int parallelAbility() const = 0;

    virtual ParallelType parallelType() const = 0;

    virtual void setParallelType(const ParallelType& type) = 0;
};

struct IParallelOpenmpEnabled
{
    virtual void setOmpThreadNum(const int threadNum) = 0;
};

struct IParallelCudaEnabled
{
    virtual void setGPUId(const int gpuId) = 0;

    virtual void setGroupSize(const double size) = 0;

};

}

#endif  // IPARALLELIZABLE_H