Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accelerator/ze: actually implement wait event #12301

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions opal/mca/accelerator/ze/accelerator_ze_module.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights reserved.
* Copyright (c) 2023 Triad National Security, LLC. All rights reserved.
* Copyright (c) 2023-2024 Triad National Security, LLC. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -370,6 +370,32 @@ static int mca_accelerator_ze_record_event(int dev_id, opal_accelerator_event_t
return OPAL_SUCCESS;
}

static int mca_accelerator_ze_wait_event(int __opal_attribute_unused__ dev_id,
opal_accelerator_event_t *event,
opal_accelerator_stream_t * __opal_attribute_unused__ stream)
{
ze_result_t zret;

zret = zeEventHostSynchronize(*((ze_event_handle_t *)event->event),
UINT64_MAX);
switch (zret) {
case ZE_RESULT_SUCCESS:
return OPAL_SUCCESS;
break;
case ZE_RESULT_NOT_READY:
return OPAL_ERR_RESOURCE_BUSY;
break;
default:
opal_output_verbose(10, opal_accelerator_base_framework.framework_output,
"zeEventHostSynchronize returned %d", zret);
return OPAL_ERROR;
}

return OPAL_SUCCESS;
}



static int mca_accelerator_ze_query_event(int dev_id, opal_accelerator_event_t *event)
{
ze_result_t zret;
Expand Down Expand Up @@ -411,7 +437,7 @@ static int mca_accelerator_ze_memcpy_async(int dest_dev_id, int src_dev_id, void
}

ze_stream = (opal_accelerator_ze_stream_t *)stream->stream;
assert(NULL != ze_stream);
assert(NULL != ze_stream);

zret = zeCommandListAppendMemoryCopy(ze_stream->hCommandList,
dest,
Expand Down
Loading