Class GPUDeviceInfo

Inheritance Relationships

Base Type

Class Documentation

class GPUDeviceInfo : public mindspore::DeviceInfoContext

Derived from DeviceInfoContext, The configuration of the model running on the GPU.

Public Functions

inline virtual enum DeviceType GetDeviceType() const override

Get the type of this DeviceInfoContext.

返回

Type of this DeviceInfoContext.

void SetDeviceID(uint32_t device_id)

Set device id.

参数

device_id[in] The device id.

uint32_t GetDeviceID() const

Get the device id.

返回

The device id.

int GetRankID() const

Get the distribution rank id.

返回

The device id.

int GetGroupSize() const

Get the distribution group size.

返回

The device id.

inline void SetPrecisionMode(const std::string &precision_mode)

Set the precision mode.

参数

precision_mode[in] Optional “origin”, “fp16”. “origin” is set as default.

inline std::string GetPrecisionMode() const

Get the precision mode.

返回

The precision mode.

void SetEnableFP16(bool is_fp16)

Set enables to perform the float16 inference.

参数

is_fp16[in] Enable float16 inference or not.

bool GetEnableFP16() const

Get enables to perform the float16 inference.

返回

Whether enable float16 inference.

void SetEnableGLTexture(bool is_enable_gl_texture)

Set enables to sharing mem with OpenGL.

参数

is_enable_gl_texture[in] Enable sharing OpenCL Memory with OpenGL or not.

bool GetEnableGLTexture() const

Get enables to sharing mem with OpenGL.

返回

Whether enable sharing mem with OpenGL.

void SetGLContext(void *gl_context)

Set current OpenGL context.

参数

gl_context[in] Current OpenGL context.

void *GetGLContext() const

Get current OpenGL context.

返回

the OpenCL context by OpenGL used.

void SetGLDisplay(void *gl_display)

Set current OpenGL display.

参数

gl_display[in] Current OpenGL display.

void *GetGLDisplay() const

Get current OpenGL display.

返回

the OpenCL display by OpenGL used.