SWDEV-389825 - intermittent failure on multithread test (#315)

- remove null stream from operation with other created streams on multithread test
- some general test fix

Change-Id: Icec7436f92a2d90dcee93ed5cdc4c8934d803fde
This commit is contained in:
ROCm CI Service Account
2023-06-29 08:57:38 +05:30
committed by GitHub
parent c24c6674ae
commit a7ab47589b
@@ -256,6 +256,8 @@ bool runFuncTestsForAllPriorityLevelsMultThread(unsigned int flags) {
int priority;
int priority_low;
int priority_high;
std::vector<hipStream_t> stream_set{};
hipStream_t stream{};
// Test is to get the Stream Priority Range
HIP_CHECK(hipDeviceGetStreamPriorityRange(&priority_low, &priority_high));
@@ -265,23 +267,19 @@ bool runFuncTestsForAllPriorityLevelsMultThread(unsigned int flags) {
return true;
}
int numOfPriorities = priority_low - priority_high;
int numOfPriorities = priority_low - priority_high + 1;
INFO("numOfPriorities : " << numOfPriorities);
// 0 idx is for default stream
std::vector<hipStream_t> stream(numOfPriorities + 1);
stream[0] = 0;
// Create a stream for each of the priority levels
int count = 1;
for (priority = priority_high; priority < priority_low; priority++) {
HIP_CHECK(hipStreamCreateWithPriority(&stream[count++], flags,
for (priority = priority_high; priority <= priority_low; priority++) {
HIP_CHECK(hipStreamCreateWithPriority(&stream, flags,
priority));
stream_set.push_back(stream);
}
for (int i = 0; i < TOTALTHREADS; i++) {
T[i] = std::thread(queueTasksInStreams,
&stream, numOfPriorities + 1);
&stream_set, numOfPriorities);
}
for (int i=0; i < TOTALTHREADS; i++) {
@@ -294,9 +292,9 @@ bool runFuncTestsForAllPriorityLevelsMultThread(unsigned int flags) {
}
// Destroy the stream for each of the priority levels
count = 1;
for (priority = priority_high; priority < priority_low; priority++) {
HIP_CHECK(hipStreamDestroy(stream[count++]));
size_t set_size = stream_set.size();
for (int i = 0; i < set_size; i++) {
HIP_CHECK(hipStreamDestroy(stream_set[i]));
}
return TestPassed;
}