cuda_pinned_places

paddle.fluid.cuda_pinned_places(device_count=None)[source]

This function creates a list of fluid.CUDAPinnedPlace objects.

If device_count is None, the device count would be determined by environment variable CPU_NUM. If CPU_NUM is not set, the default value is 1, i.e. CPU_NUM=1. CPU_NUM indicates the number of devices used in the current task. The running of the program can be accelerated if CPU_NUM is the same as the number of physical cores.

Parameters

device_count (int, optional) – device number. Default: None.

Returns

Created list of CUDA pinned places.

Return type

list of fluid.CUDAPinnedPlace

Examples

import paddle.fluid as fluid
cuda_pinned_places_cpu_num = fluid.cuda_pinned_places()
# or
cuda_pinned_places = fluid.cuda_pinned_places(1)