昇腾社区首页
中文
注册

hset_flag & hwait_flag

为了减少同步延迟,提供了hset和hwait标志指令,hset_flag指令中的目的内存由指令立即数指定,都放置在实际的生成者或消费者指令之前。这样可以在同步发生之前通知硬件数据依赖的确切位置。

表1 hset/hwait特有参数说明

参数名

说明

memory

指定的依赖内存

v

虚拟指示器,0表示valid,1表示虚拟

eventID

2bit事件ID,仅支持4个事件ID。

由于“set & wait”标志必须成对出现,因此在循环体前后会插入多个“虚拟”的“set”or “wait”标志,引入了一个新的参数v来指示指令是否为虚拟指令。

函数原型

void hset_flag(pipe_t pipe, pipe_t tpipe, event_t eventID, mem_t memory, bool v)
void hset_flag(pipe_t pipe, pipe_t tpipe, uint64_t eventID, mem_t memory, bool v)
void hwait_flag(pipe_t pipe, pipe_t tpipe, uint64_t eventID, mem_t memory, bool v)
void hwait_flag(pipe_t pipe, pipe_t tpipe, event_t eventID, mem_t memory, bool v)

流水类型

PIPE_S