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

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

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

Parameters
  • [in] passes: passes’ types.

void EnableCUDNN()

Enable the use of cuDNN kernel.

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.

void EnableMkldnnQuantizer()

Enable MKLDNN quantize optimization.

bool use_gpu() const

Check if we are using gpu.

Return

A bool variable implying whether we are in gpu mode.

~PassStrategy() = default

Default destructor.