使用这个接口对于多进程有没有优化?
楼上正解!
cnrtRet_t cnrtSetDeviceFlag(unsigned int *flags)
Return CNRT_RET_SUCCESS if success, otherwise with the error code.
Parameters
• flags[in]: returns a device queue flag which can be 0 or 1. 0 means CNRT_QUEUE_SYNC_SPIN(default), 1 means CNRT_QUEUE_SYNC_BLOCK.
CNRT_QUEUE_SYNC_SPIN: Instruct CNRT to actively spin when waiting for results from the device. This can decrease latency when waiting for the device, but may lower the performance of CPU threads if they are performing work in parallel with the CNRT thread.
CNRT_QUEUE_SYNC_BLOCK: Instruct CNRT to block the CPU thread on a synchronization primitive when waiting for the device to finish work.
请登录后评论