Add HIP_CHECK_THREAD and REQUIRE_THREAD macro for multi threaded HIP API tests (#2664)
This commit is contained in:
1 parent
902eae64e3
commit
5afcd13390
7 files changed
+414
-101
No files matched your search
@@ -95,11 +95,11 @@ __global__ void waiting_kernel(int* semaphore) {
|
||||
std::thread startSignalingThread(int* semaphore) {
|
||||
std::thread signalingThread([semaphore]() {
|
||||
hipStream_t signalingStream;
|
||||
HIP_CHECK(hipStreamCreateWithFlags(&signalingStream, hipStreamNonBlocking));
|
||||
HIP_CHECK_THREAD(hipStreamCreateWithFlags(&signalingStream, hipStreamNonBlocking));
|
||||
|
||||
signaling_kernel<<<1, 1, 0, signalingStream>>>(semaphore);
|
||||
HIP_CHECK(hipStreamSynchronize(signalingStream));
|
||||
HIP_CHECK(hipStreamDestroy(signalingStream));
|
||||
HIP_CHECK_THREAD(hipStreamSynchronize(signalingStream));
|
||||
HIP_CHECK_THREAD(hipStreamDestroy(signalingStream));
|
||||
});
|
||||
|
||||
return signalingThread;
|
||||
|
||||
@@ -44,6 +44,7 @@ __global__ void waiting_kernel(int* semaphore = nullptr);
|
||||
/**
|
||||
* @brief Creates a thread that runs a signaling_kernel on a non-blocking stream.
|
||||
* hipStreamNonBlocking is used here to avoid interfering with tests for the Null Stream.
|
||||
* You must call HIP_CHECK_THREAD_FINALIZE after joining this thread.
|
||||
*
|
||||
* @param semaphore memory location to signal
|
||||
* @return std::thread thread that has to be joined after the testing is done.
|
||||
|
||||
Reference in new issue
Block a user