Class PassStrategy

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class paddle::PassStrategy : public paddle::PaddlePassBuilder

This class defines the pass strategies like whether to use gpu/cuDNN kernel/MKLDNN.

Subclassed by paddle::CpuPassStrategy, paddle::GpuPassStrategy

Public Functions

inline explicit PassStrategy(const std::vector<std::string> &passes)

Constructor of PassStrategy class. It works the same as PaddlePassBuilder class.

Parameters

passes[in] passes’ types.

inline virtual void EnableCUDNN()

Enable the use of cuDNN kernel.

inline virtual void EnableMKLDNN()

Enable the use of MKLDNN. The MKLDNN control exists in both CPU and GPU mode, because there can still be some CPU kernels running in GPU mode.

inline virtual void EnableMkldnnQuantizer()

Enable MKLDNN quantize optimization.

inline bool use_gpu() const

Check if we are using gpu.

Returns

A bool variable implying whether we are in gpu mode.

virtual ~PassStrategy() = default

Default destructor.