SWDEV-534207 - solve phoenix mem test failures (#218)
* make sure symbolStatus after hipGetProcAddress() is the expected in the tests that are failing on Phoenix * fix that calls to hipMemset2DAsync() and hipMemset2DAsync_spt() to set values on submatrices where not taking into account the pitch, causing test failures on Phoenix * before testing whether hipMemset2DAsync() works, initialize the whole matrix to a known value. This makes sure the test fails even if the uninitialized memory returned after hipMallocPitch() happens to have the expected value * Sbefore testing whether hipMemset2DAsync_spt() works, initialize the whole matrix to a known value. This makes sure the test fails even if the uninitialized memory returned after hipMallocPitch() happens to have the expected value * fix up compiler error: dyn_hipMemset2DAsync_ptr should have been dyn_hipMemset2DAsync_spt_ptr * when Unit_hipMalloc3D_Basic fails due to a potential memory leak, print the values that hipMemGetInfo() returns before and after the allocation/deallocation pair. * Also print intermediate free memory * Make sure Unit_hipMalloc3D_Basic allocates at least PalSettings::subAllocationChunkSize_ on Windows. Otherwise hipMemGetInfo() will not report an increase on available memory after hipFree() is called, as the minimum amount of memory that cause a call to the CoarseMemorySubAllocator::Create() is that chunk size * Fix up previous commit; allocated too much memory * skip some extent sizes in Unit_hipFreeMipmappedArrayImplicitSyncArray if allocating them would be require more memory than the actual totalGlobalMem of the device * Do not expect an exact match when comparing the memory available memory before and after hipMalloc3D() + hipFree() * Do not allocate more memory than the total GPU memory in Unit_hipFreeMipmappedArrayImplicitSyncArray * fix expected available memory amount comparison in hipMalloc3D - Basic * use SUCCEED() macro in Unit_hipFreeMipmappedArrayImplicitSyncArray to log more information when there is not enough memory for the mipmapped array to be allocated * fix formatting
This commit is contained in:
1 orang tua
0c318b4ca5
melakukan
4b2ed7653f
4 files changed
+112
-54
No files matched your search
@@ -2761,22 +2761,23 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset2D3D") {
|
||||
void* hipMemset2DAsync_ptr = nullptr;
|
||||
void* hipMemset3D_ptr = nullptr;
|
||||
void* hipMemset3DAsync_ptr = nullptr;
|
||||
hipDriverProcAddressQueryResult symbolStatus = HIP_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND;
|
||||
|
||||
int currentHipVersion = 0;
|
||||
HIP_CHECK(hipRuntimeGetVersion(¤tHipVersion));
|
||||
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset2D",
|
||||
&hipMemset2D_ptr,
|
||||
currentHipVersion, 0, nullptr));
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset2DAsync",
|
||||
&hipMemset2DAsync_ptr,
|
||||
currentHipVersion, 0, nullptr));
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset3D",
|
||||
&hipMemset3D_ptr,
|
||||
currentHipVersion, 0, nullptr));
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset3DAsync",
|
||||
&hipMemset3DAsync_ptr,
|
||||
currentHipVersion, 0, nullptr));
|
||||
HIP_CHECK(
|
||||
hipGetProcAddress("hipMemset2D", &hipMemset2D_ptr, currentHipVersion, 0, &symbolStatus));
|
||||
REQUIRE(symbolStatus == HIP_GET_PROC_ADDRESS_SUCCESS);
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset2DAsync", &hipMemset2DAsync_ptr, currentHipVersion, 0,
|
||||
&symbolStatus));
|
||||
REQUIRE(symbolStatus == HIP_GET_PROC_ADDRESS_SUCCESS);
|
||||
HIP_CHECK(
|
||||
hipGetProcAddress("hipMemset3D", &hipMemset3D_ptr, currentHipVersion, 0, &symbolStatus));
|
||||
REQUIRE(symbolStatus == HIP_GET_PROC_ADDRESS_SUCCESS);
|
||||
HIP_CHECK(hipGetProcAddress("hipMemset3DAsync", &hipMemset3DAsync_ptr, currentHipVersion, 0,
|
||||
&symbolStatus));
|
||||
REQUIRE(symbolStatus == HIP_GET_PROC_ADDRESS_SUCCESS);
|
||||
|
||||
hipError_t (*dyn_hipMemset2D_ptr)(void *, size_t, int, size_t, size_t) =
|
||||
reinterpret_cast<hipError_t (*)(void *, size_t, int, size_t, size_t)>
|
||||
@@ -2829,6 +2830,10 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset2D3D") {
|
||||
&pitch, width, height));
|
||||
REQUIRE(devMem != nullptr);
|
||||
|
||||
// set the whole matrix first to something different than 'value'
|
||||
HIP_CHECK(dyn_hipMemset2DAsync_ptr(devMem, pitch, 5, width, height, 0));
|
||||
HIP_CHECK(hipStreamSynchronize(0));
|
||||
|
||||
hipStream_t stream[Ns];
|
||||
for ( int s = 0; s < Ns; s++ ) {
|
||||
HIP_CHECK(hipStreamCreate(&stream[s]));
|
||||
@@ -2836,8 +2841,9 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset2D3D") {
|
||||
|
||||
for ( int s = 0; s < Ns; s++ ) {
|
||||
int startIndex = s * (N/Ns);
|
||||
HIP_CHECK(dyn_hipMemset2DAsync_ptr(devMem + startIndex, pitch/Ns,
|
||||
value, width/Ns, height/Ns, stream[s]));
|
||||
int row = startIndex / width;
|
||||
HIP_CHECK(dyn_hipMemset2DAsync_ptr(devMem + row * pitch, pitch, value, width, height / Ns,
|
||||
stream[s]));
|
||||
}
|
||||
for ( int s = 0; s < Ns; s++ ) {
|
||||
HIP_CHECK(hipStreamSynchronize(stream[s]));
|
||||
|
||||
Reference in new issue
Block a user