nlcpy.venode.VE

nlcpy.venode.VE(int veid=-1) VENode

Gets an instance of nlcpy.venode.VENode.

Parameters
veidint

VE device id. The veid must be satisfied with a following condition.

0 <= veid < get_num_available_venodes()

if set to -1 (default), the current active VE node is returned.

Examples

>>> import nlcpy
>>> with nlcpy.venode.VE(0) as ve0:
...     # Operations run on VE#0
...     nlcpy.array([1, 2, 3]).venode  
<VE node logical_id=0, physical_id=0>
>>> with nlcpy.venode.VE(1) as ve1:
...     # Operations run on VE#1
...     nlcpy.array([1, 2, 3]).venode  
<VE node logical_id=1, physical_id=1>