SWDEV-465220 - Update Kernel Launch negative cases to match with current CLR code.

Change-Id: I891544cdfdc1092467454189ea348f986fc12818
Este cometimento está contido em:
Jaydeep Patel criou e Rakesh Roy cometeu 2025-03-03 10:48:18 -05:00
1 ascendente 5007b3f5e4
cometimento 192528c7f2
6 ficheiros modificados
+266 -25

Não existem ficheiros que correspondam à sua pesquisa

+5 -5
Ver ficheiro
@@ -114,21 +114,21 @@ TEST_CASE("Unit_hipExtLaunchKernel_Negative_Parameters") {
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),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
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),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
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),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("blockDim.x * blockDim.y * blockDim.z > maxThreadsPerBlock") {
@@ -137,14 +137,14 @@ 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),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("sharedMemBytes > maxSharedMemoryPerBlock") {
const unsigned int max = GetDeviceAttribute(hipDeviceAttributeMaxSharedMemoryPerBlock, 0) + 1u;
HIP_CHECK_ERROR(hipExtLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{1, 1, 1}, nullptr, max, nullptr, nullptr, nullptr, 0u),
hipErrorOutOfMemory);
hipErrorInvalidValue);
}
SECTION("Invalid stream") {
+5 -5
Ver ficheiro
@@ -113,21 +113,21 @@ TEST_CASE("Unit_hipLaunchKernel_Negative_Parameters") {
const unsigned int x = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimX, 0) + 1u;
HIP_CHECK_ERROR(hipLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1}, dim3{x, 1, 1},
nullptr, 0, nullptr),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("blockDim.y > maxBlockDimY") {
const unsigned int y = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimY, 0) + 1u;
HIP_CHECK_ERROR(hipLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1}, dim3{1, y, 1},
nullptr, 0, nullptr),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("blockDim.z > maxBlockDimZ") {
const unsigned int z = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimZ, 0) + 1u;
HIP_CHECK_ERROR(hipLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1}, dim3{1, 1, z},
nullptr, 0, nullptr),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("blockDim.x * blockDim.y * blockDim.z > maxThreadsPerBlock") {
@@ -135,14 +135,14 @@ TEST_CASE("Unit_hipLaunchKernel_Negative_Parameters") {
const unsigned int dim = std::ceil(std::cbrt(max));
HIP_CHECK_ERROR(hipLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1},
dim3{dim, dim, dim}, nullptr, 0, nullptr),
hipErrorInvalidConfiguration);
hipErrorInvalidValue);
}
SECTION("sharedMemBytes > maxSharedMemoryPerBlock") {
const unsigned int max = GetDeviceAttribute(hipDeviceAttributeMaxSharedMemoryPerBlock, 0) + 1u;
HIP_CHECK_ERROR(hipLaunchKernel(reinterpret_cast<void*>(kernel), dim3{1, 1, 1}, dim3{1, 1, 1},
nullptr, max, nullptr),
hipErrorOutOfMemory);
hipErrorInvalidValue);
}
SECTION("Invalid stream") {
+1 -1
Ver ficheiro
@@ -271,7 +271,7 @@ TEST_CASE("Unit_hipExtModuleLaunchKernel_Positive_Parameters") {
}
TEST_CASE("Unit_hipExtModuleLaunchKernel_Negative_Parameters") {
ModuleLaunchKernelNegativeParameters<hipExtModuleLaunchKernel>();
ModuleLaunchKernelNegativeParameters<hipExtModuleLaunchKernel>(true);
}
/**
* Test Description
+17 -11
Ver ficheiro
@@ -118,8 +118,13 @@ template <ExtModuleLaunchKernelSig* func> void ModuleLaunchKernelPositiveParamet
}
}
template <ExtModuleLaunchKernelSig* func> void ModuleLaunchKernelNegativeParameters() {
template <ExtModuleLaunchKernelSig* func> void ModuleLaunchKernelNegativeParameters(
bool extLaunch = false) {
hipFunction_t f = GetKernel(mg.module(), "NOPKernel");
hipError_t expectedErrorZeroBlockDim = (extLaunch == true) ? hipErrorInvalidConfiguration
: hipErrorInvalidValue;
hipError_t expectedErrorOverCapacityGridDim = (extLaunch == true) ? hipSuccess
: hipErrorInvalidValue;
SECTION("f == nullptr") {
HIP_CHECK_ERROR(
@@ -144,35 +149,35 @@ template <ExtModuleLaunchKernelSig* func> void ModuleLaunchKernelNegativeParamet
SECTION("blockDimX == 0") {
HIP_CHECK_ERROR(func(f, 1, 1, 1, 0, 1, 1, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorZeroBlockDim);
}
SECTION("blockDimY == 0") {
HIP_CHECK_ERROR(func(f, 1, 1, 1, 1, 0, 1, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorZeroBlockDim);
}
SECTION("blockDimZ == 0") {
HIP_CHECK_ERROR(func(f, 1, 1, 1, 1, 1, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorZeroBlockDim);
}
SECTION("gridDimX > maxGridDimX") {
const unsigned int x = GetDeviceAttribute(hipDeviceAttributeMaxGridDimX, 0) + 1u;
HIP_CHECK_ERROR(func(f, x, 1, 1, 1, 1, 1, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorOverCapacityGridDim);
}
SECTION("gridDimY > maxGridDimY") {
const unsigned int y = GetDeviceAttribute(hipDeviceAttributeMaxGridDimY, 0) + 1u;
HIP_CHECK_ERROR(func(f, 1, y, 1, 1, 1, 1, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorOverCapacityGridDim);
}
SECTION("gridDimZ > maxGridDimZ") {
const unsigned int z = GetDeviceAttribute(hipDeviceAttributeMaxGridDimZ, 0) + 1u;
HIP_CHECK_ERROR(func(f, 1, 1, z, 1, 1, 1, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorInvalidValue);
expectedErrorOverCapacityGridDim);
}
SECTION("blockDimX > maxBlockDimX") {
@@ -207,16 +212,17 @@ template <ExtModuleLaunchKernelSig* func> void ModuleLaunchKernelNegativeParamet
hipErrorInvalidValue);
}
// Disabled on AMD due to defect - EXSWHTEC-160
#if HT_NVIDIA
SECTION("Invalid stream") {
hipStream_t stream = nullptr;
HIP_CHECK(hipStreamCreate(&stream));
HIP_CHECK(hipStreamDestroy(stream));
hipError_t err = hipErrorInvalidValue;
#if HT_NVIDIA
err = hipErrorContextIsDestroyed;
#endif
HIP_CHECK_ERROR(func(f, 1, 1, 1, 1, 1, 0, 0, stream, nullptr, nullptr, nullptr, nullptr, 0u),
hipErrorContextIsDestroyed);
err);
}
#endif
SECTION("Passing kernel_args and extra simultaneously") {
hipFunction_t f = GetKernel(mg.module(), "Kernel42");