paddle.fluid.framework. 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.


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


Created list of CUDA pinned places.

Return type

list of fluid.CUDAPinnedPlace


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