Edge DPU runtime N2Cube support DPU core affinity with the API
dpuSetTaskAffinity()
, which can be used to dynamically assign DPU
tasks to desired DPU cores so that the users can participate in DPU cores' assignment
and scheduling as required. DPU cores’ affinity is specified with the second argument
coreMask
to dpuSetTaskAffinity()
. Each bit of
coreMask
represents one DPU core: the lowest bit is for core 0,
second lowest bit is for core 1, and so on. Multiple mask bits can be specified one time
but can’t exceed the maximum available DPU cores. For example, the mask value 0x3
indicates that a task can be assigned to DPU core 0 and 1, and it is scheduled right
away if either core 0 or 1 is available.