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/rocm: some minor fixes #12341

Merged

Conversation

edgargabriel
Copy link
Member

  • memset the IPC handles to zero before calling hipIpcGetMemHandle (and the event counter part)
  • get_buffer_id: fix the buffer_id argument passed to the hip call.

@wenduwan
Copy link
Contributor

I just noticed that we didn't provide constructor/destructor

OBJ_CLASS_INSTANCE(
    opal_accelerator_stream_t,
    opal_object_t,
    NULL,
    NULL);

OBJ_CLASS_INSTANCE(
    opal_accelerator_event_t,
    opal_object_t,
    NULL,
    NULL);

OBJ_CLASS_INSTANCE(
    opal_accelerator_ipc_handle_t,
    opal_object_t,
    NULL,
    NULL);

OBJ_CLASS_INSTANCE(
    opal_accelerator_ipc_event_handle_t,
    opal_object_t,
    NULL,
    NULL);

Would it be better to reset the object in the constructor instead?

@edgargabriel
Copy link
Member Author

@wenduwan I am not sure I follow your comment, can you please explain a bit more?

@wenduwan
Copy link
Contributor

Sorry I got confused. I just realized hipIpcMemHandle_t is not an OPAL object.

My original comment was about the opal_accelerator_rocm_ipc_event_handle_t object and its parent class - I figured that we are not initializing the object to zero values because we did not define the constructor.

@edgargabriel edgargabriel force-pushed the topic/accel-rocm-minor-fixes branch 2 times, most recently from 9af4e82 to e58222b Compare February 19, 2024 20:03
- memset the IPC handles to zero before calling hipIpcGetMemHandle (and
  the event counter part)
- get_buffer_id: fix the buffer_id argument passed to the hip call.
- correctly set device_id in check_addr()

Signed-off-by: Edgar Gabriel <[email protected]>
@edgargabriel edgargabriel force-pushed the topic/accel-rocm-minor-fixes branch from e58222b to afacd60 Compare February 20, 2024 19:05
Copy link
Contributor

@wenduwan wenduwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot test the change but it looks reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants