Commit 21e243b3 authored by xgqdut2016's avatar xgqdut2016 Committed by thatPepe
Browse files

issue/640: 增加沐曦eventElapseTime, eventCreateWithFlags接口

parent 3f042fd3
......@@ -56,7 +56,21 @@ infiniStatus_t eventCreate(infinirtEvent_t *event_ptr) {
}
infiniStatus_t eventCreateWithFlags(infinirtEvent_t *event_ptr, uint32_t flags) {
return INFINI_STATUS_NOT_IMPLEMENTED;
hcEvent_t event;
unsigned int hc_flags = hcEventDefault;
// 映射 InfiniCore 的 flags 到 HC Runtime flags
if (flags & INFINIRT_EVENT_DISABLE_TIMING) {
hc_flags |= hcEventDisableTiming;
}
if (flags & INFINIRT_EVENT_BLOCKING_SYNC) {
hc_flags |= hcEventBlockingSync;
}
CHECK_MACART(hcEventCreateWithFlags(&event, hc_flags));
*event_ptr = event;
return INFINI_STATUS_SUCCESS;
}
infiniStatus_t eventRecord(infinirtEvent_t event, infinirtStream_t stream) {
......@@ -80,7 +94,8 @@ infiniStatus_t eventDestroy(infinirtEvent_t event) {
}
infiniStatus_t eventElapsedTime(float *ms_ptr, infinirtEvent_t start, infinirtEvent_t end) {
return INFINI_STATUS_NOT_IMPLEMENTED;
CHECK_MACART(hcEventElapsedTime(ms_ptr, (hcEvent_t)start, (hcEvent_t)end));
return INFINI_STATUS_SUCCESS;
}
infiniStatus_t mallocDevice(void **p_ptr, size_t size) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment