SWDEV-508973 - Fix the catch tests failures due to change in kernel validation error codes to match CUDA (#198)

This commit is contained in:
Dittakavi, Satyanvesh
2025-05-26 18:41:58 +05:30
committed by GitHub
parent 74e743dcb9
commit 1be3aa8283
3 changed files with 22 additions and 23 deletions
@@ -77,58 +77,58 @@ TEST_CASE("Unit_hipExtLaunchKernel_Negative_Parameters") {
SECTION("gridDim.x == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{0, 1, 1},
dim3{1, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("gridDim.y == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 0, 1},
dim3{1, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("gridDim.z == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 0},
dim3{1, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.x == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{0, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.y == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{1, 0, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.z == 0") {
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{1, 1, 0}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.x > maxBlockDimX") {
const unsigned int x = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimX, 0) + 1u;
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{x, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.y > maxBlockDimY") {
const unsigned int y = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimY, 0) + 1u;
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{1, y, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.z > maxBlockDimZ") {
const unsigned int z = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimZ, 0) + 1u;
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{1, 1, z}, nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("blockDim.x * blockDim.y * blockDim.z > maxThreadsPerBlock") {
@@ -137,7 +137,7 @@ TEST_CASE("Unit_hipExtLaunchKernel_Negative_Parameters") {
HIP_CHECK_ERROR(
hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1}, dim3{dim, dim, dim},
nullptr, 0, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
hipErrorInvalidConfiguration);
}
SECTION("sharedMemBytes > maxSharedMemoryPerBlock") {