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

hipStreamPerThread multi-thread test not work #449

Open
kevin-gjm opened this issue Dec 27, 2023 · 2 comments
Open

hipStreamPerThread multi-thread test not work #449

kevin-gjm opened this issue Dec 27, 2023 · 2 comments

Comments

@kevin-gjm
Copy link

kevin-gjm commented Dec 27, 2023

in the test case, after detach the created thread also exited. I think the case can't fully test the function of "hipStreamPerThread".

pthread_detach man page.
'''
The detached attribute merely determines the behavior of the
system when the thread terminates; it does not prevent the thread
from being terminated if the process terminates using exit(3) (or
equivalently, if the main thread returns).
''''

I think this case is mainly to check the new thread not have stream dependence(one thread with hipStreamPerThread exit, not effect other threads).
what about add a rand sleep in below function (Copy_to_device) to check the dependence? and change detach to join.

https://github.com/ROCm/hip-tests/blob/f5deb13ce32126176fdae4ed6b3c38ab792738ef/catch/unit/streamperthread/hipStreamPerThread_MultiThread.cc#L24C17-L24C17

@ppanchad-amd
Copy link

Hi @kevin-gjm, internal ticket has been created to investigate this issue. Thanks!

@schung-amd
Copy link

schung-amd commented Sep 16, 2024

Hi @kevin-gjm, the pthread documentation is not relevant here as the test uses std::threads. The comments in the test identify the scenario that is being tested and what we're watching for in this test:

Scenario : App pushes Async task(s) into hipStreamPerThread and did not wait for it to complete.
Watch out : Incomplete task in hipStreamPerThread should not cause any crash due to thread exit.

This test is not meant to cover the full functionality of hipStreamPerThread, but only to test this specific scenario. Additional tests covering more of hipStreamPerThread can be found in the parent directory.

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

No branches or pull requests

3 participants