sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * cu_done() - Check status of CU
 * 
 * @cu_idx: Index of cu to check
 *
 * This function is called in polling mode only.  The cu_idx
 * is guaranteed to have been started
 *
 * Return: %true if cu done, %false otherwise
 */
Check status of CU

@cu_idx: Index of cu to check

This function is called in polling mode only.  The cu_idx
is guaranteed to have been started

%true if cu done, %false otherwise
Check status of CU @cu_idx : Index of cu to check This function is called in polling mode only . The cu_idx is guaranteed to have been started %true if cu done %false otherwise
inline int
cu_done(struct drm_xocl_dev *xdev, unsigned int cu_idx)
{
	u32 cu_addr = cu_idx_to_addr(xdev,cu_idx);
	SCHED_DEBUGF("-> cu_done(,%d) checks cu at address 0x%x\n",cu_idx,cu_addr);
	if (ioread32(xdev->user_bar + cu_addr) & 2) {
		unsigned int mask_idx = cu_mask_idx(cu_idx);
		unsigned int pos = cu_idx_in_mask(cu_idx);
		xdev->exec.cu_status[mask_idx] ^= 1<<pos;
		SCHED_DEBUG("<- cu_done returns 1\n");
		return true;
	}
	SCHED_DEBUG("<- cu_done returns 0\n");
	return false;
}
inline int cu_done ( struct drm_xocl_dev * xdev , unsigned int cu_idx ) { u32 cu_addr = cu_idx_to_addr ( xdev , cu_idx ) ; SCHED_DEBUGF ( " \n " , cu_idx , cu_addr ) ; if ( ioread32 ( xdev -> user_bar + cu_addr ) & 2 ) { unsigned int mask_idx = cu_mask_idx ( cu_idx ) ; unsigned int pos = cu_idx_in_mask ( cu_idx ) ; xdev -> exec . cu_status [ mask_idx ] ^= 1 << pos ; SCHED_DEBUG ( " \n " ) ; return true ; } SCHED_DEBUG ( " \n " ) ; return false ; }
cu_done() - Check status of CU
cu_done () - Check status of CU
/* done is indicated by AP_DONE(2) alone or by AP_DONE(2) | AP_IDLE(4)
	 * but not by AP_IDLE itself.  Since 0x10 | (0x10 | 0x100) = 0x110 
	 * checking for 0x10 is sufficient. */