* test fixes

* address PR comment

* PR comment fixing Nvidia pass

* add additional kernel launch checks

* pr comments
Цей коміт міститься в:
Paulius Velesko
2022-10-01 01:07:25 +03:00
зафіксовано GitHub
джерело 609edf1c9e
коміт da453211ed
94 змінених файлів з 177 додано та 34 видалено
+2
Переглянути файл
@@ -59,8 +59,10 @@ TEST_CASE("Unit_hipStreamCreate_MultistreamBasicFunctionalities") {
hipLaunchKernelGGL(HIP_KERNEL_NAME(hipAPIStreamDisableTest::kernel),
dim3(1), dim3(1), 0, streams[i], data[i], xd,
hipAPIStreamDisableTest::NN);
HIP_CHECK(hipGetLastError());
hipLaunchKernelGGL(HIP_KERNEL_NAME(hipAPIStreamDisableTest::nKernel),
dim3(1), dim3(1), 0, 0, yd);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipStreamDestroy(streams[i]));
}
HIP_CHECK(hipMemcpy(&x, xd, sizeof(float), hipMemcpyDeviceToHost));
+4
Переглянути файл
@@ -49,7 +49,9 @@ TEST_CASE("Unit_hipMultiStream_sameDevice") {
HIP_CHECK(hipStreamCreate(&streams[i]));
HIP_CHECK(hipMalloc(&data[i], NN * sizeof(float)));
hipLaunchKernelGGL(kernel, dim3(1), dim3(1), 0, streams[i], data[i], xd, NN);
HIP_CHECK(hipGetLastError());
hipLaunchKernelGGL(HIP_KERNEL_NAME(nKernel), dim3(1), dim3(1), 0, 0, yd);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipFree(data[i]));
HIP_CHECK(hipStreamDestroy(streams[i]));
}
@@ -80,9 +82,11 @@ TEST_CASE("Unit_hipMultiStream_multimeDevice") {
HIP_CHECK(hipDeviceSynchronize());
// Launch kernel with default stream
hipLaunchKernelGGL(kernel_do_nothing, dim3(1), dim3(1), 0, 0, 1);
HIP_CHECK(hipGetLastError());
// Launch kernel on all streams
for (int i = 0; i < nStreams; i++) {
hipLaunchKernelGGL(kernel_do_nothing, dim3(1), dim3(1), 0, streams[i], 1);
HIP_CHECK(hipGetLastError());
}
// Sync stream 1
HIP_CHECK(hipStreamSynchronize(streams[0]));
+1 -1
Переглянути файл
@@ -131,7 +131,7 @@ TEST_CASE("Unit_hipStreamAddCallback_MultipleThreads") {
hipLaunchKernelGGL((device_function), dim3(blocks),
dim3(threadsPerBlock), 0,
mystream, C_d, A_d, N);
HIP_CHECK(hipGetLastError());
HIP_CHECK(
hipMemcpyAsync(C1_h, C_d, Nbytes,
hipMemcpyDeviceToHost, mystream));
+2 -2
Переглянути файл
@@ -86,7 +86,7 @@ bool testStreamCallbackFunctionality(bool isDefault) {
const unsigned threadsPerBlock = 256;
hipLaunchKernelGGL((HipTest::vector_square), dim3(blocks),
dim3(threadsPerBlock), 0, 0, A_d, C_d, NSize);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
0));
HIP_CHECK(hipStreamAddCallback(0, Callback, nullptr, 0));
@@ -102,7 +102,7 @@ bool testStreamCallbackFunctionality(bool isDefault) {
const unsigned threadsPerBlock = 256;
hipLaunchKernelGGL((HipTest::vector_square), dim3(blocks),
dim3(threadsPerBlock), 0, mystream, A_d, C_d, NSize);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
mystream));
HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0));
+3
Переглянути файл
@@ -146,6 +146,7 @@ void funcTestsForAllPriorityLevelsWrtNullStrm(unsigned int flags,
hipLaunchKernelGGL((HipTest::vector_square), dim3(GRIDSIZE),
dim3(BLOCKSIZE), 0, stream[idx], A_d[idx],
C_d[idx], MEMCPYSIZE2);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpyAsync(C_h[idx], C_d[idx], size,
hipMemcpyDeviceToHost, stream[idx]));
}
@@ -227,6 +228,7 @@ void queueTasksInStreams(std::vector<hipStream_t> *stream,
hipLaunchKernelGGL((HipTest::vector_square), dim3(GRIDSIZE),
dim3(BLOCKSIZE), 0, (*stream)[idx], A_d[idx],
C_d[idx], MEMCPYSIZE2);
HIP_CHECK(hipGetLastError());
HIPCHECK(hipMemcpyAsync(C_h[idx], C_d[idx], size,
hipMemcpyDeviceToHost, (*stream)[idx]));
}
@@ -426,6 +428,7 @@ bool validateStreamPrioritiesWithEvents() {
hipLaunchKernelGGL((memcpy_kernel<T>), dim3(GRIDSIZE), \
dim3(BLOCKSIZE), 0, stream_##x, dst_d_##x + j, src_d_##x + j, \
(MEMCPYSIZE / sizeof(T))); \
HIP_CHECK(hipGetLastError()); \
}
OP(low)
OP(normal)
+3
Переглянути файл
@@ -157,6 +157,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc") {
const unsigned threadsPerBlock = BLOCKSIZE;
hipLaunchKernelGGL((HipTest::vector_square), dim3(blocks),
dim3(threadsPerBlock), 0, mystream, A_d, C_d, N);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost,
mystream));
HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0));
@@ -250,6 +251,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_Functionality") {
hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks),
dim3(threadsPerBlock), 0, streams[0], dA[0], dC[0], N);
HIP_CHECK(hipGetLastError());
HIP_CHECK(hipDeviceSynchronize());
auto single_end = std::chrono::steady_clock::now();
@@ -269,6 +271,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_Functionality") {
<< streams[np] << " with CU mask: 0x" << ss[np].str().c_str());
hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks),
dim3(threadsPerBlock), 0, streams[np], dA[np], dC[np], N);
HIP_CHECK(hipGetLastError());
}
HIP_CHECK(hipDeviceSynchronize());