Skip to content

Commit

Permalink
SWDEV-369555 - Update and enable hipMemAdvise test (#126)
Browse files Browse the repository at this point in the history
Change-Id: If291514eeacef21dea99bc4b4a78bc98fb0bc1ca
  • Loading branch information
rocm-ci authored Feb 7, 2023
1 parent 30d616d commit 554ab5d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions catch/unit/memory/hipMemAdvise_old.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,6 @@ TEST_CASE("Unit_hipMemAdvise_NegtveTsts") {
std::string str;
HIP_CHECK(hipGetDeviceCount(&NumDevs));
HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE * 2, hipMemAttachGlobal));
#if HT_AMD
// Passing invalid value(99) device param
IfTestPassed &= CheckError(hipMemAdvise(Hmm, MEM_SIZE * 2,
hipMemAdviseSetReadMostly, 99), __LINE__);

// Passing invalid value(-12) device param
IfTestPassed &= CheckError(hipMemAdvise(Hmm, MEM_SIZE * 2,
hipMemAdviseSetReadMostly, -12), __LINE__);
#endif
// Passing NULL as first parameter instead of valid pointer to a memory
IfTestPassed &= CheckError(hipMemAdvise(NULL, MEM_SIZE * 2,
hipMemAdviseSetReadMostly, 0), __LINE__);
Expand Down Expand Up @@ -378,6 +369,12 @@ TEST_CASE("Unit_hipMemAdvise_ReadMostly") {
WARN("out value: " << out);
IfTestPassed = false;
}
// hipMemAdvise should succeed for SetReadMostly and UnsetReadMostly
// irrespective of the device
HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, 99));

HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseUnsetReadMostly, -12));

HIP_CHECK(hipFree(Hmm));
REQUIRE(IfTestPassed);
} else {
Expand Down

0 comments on commit 554ab5d

Please sign in to comment.