Skip to content

Commit 5a1878c

Browse files
committed
EXSWHTEC-83 - Correct bug in Flags_Do_Not_Cause_Prefetch, and minor code corectness touchups
1 parent 736eff8 commit 5a1878c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/catch/unit/memory/hipMemAdvise.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ TEST_CASE("Unit_hipMemAdvise_Set_Unset_Basic") {
7474

7575
const auto SetUnset = [=](const hipMemoryAdvise advice) {
7676
LinearAllocGuard<uint8_t> alloc(LinearAllocs::hipMallocManaged, kPageSize);
77-
int32_t attribute = 0u;
77+
int32_t attribute = 0;
7878
HIP_CHECK(hipMemAdvise(alloc.ptr(), kPageSize, advice, device));
7979
HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute), GetMemAdviceAttr(advice),
8080
alloc.ptr(), kPageSize));
@@ -110,7 +110,7 @@ TEST_CASE("Unit_hipMemAdvise_No_Flag_Interference") {
110110
}
111111

112112
for (const auto a : advice) {
113-
auto attribute = 0u;
113+
int32_t attribute = 0;
114114
HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute), GetMemAdviceAttr(a),
115115
alloc.ptr(), kPageSize));
116116
REQUIRE((a == hipMemAdviseSetReadMostly ? 1 : device) == attribute);
@@ -158,8 +158,8 @@ TEST_CASE("Unit_hipMemAdvise_Flags_Do_Not_Cause_Prefetch") {
158158

159159
const auto Test = [](const int device, const hipMemoryAdvise advice) {
160160
LinearAllocGuard<void> alloc(LinearAllocs::hipMallocManaged, kPageSize);
161-
HIP_CHECK(hipMemAdvise(alloc.ptr(), kPageSize, hipMemAdviseSetPreferredLocation, device));
162-
int32_t attribute = 0u;
161+
HIP_CHECK(hipMemAdvise(alloc.ptr(), kPageSize, advice, device));
162+
int32_t attribute = 0;
163163
HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute),
164164
hipMemRangeAttributeLastPrefetchLocation, alloc.ptr(),
165165
kPageSize));
@@ -193,7 +193,7 @@ TEST_CASE("Unit_hipMemAdvise_Read_Write_After_Advise") {
193193
ArrayFindIfNot(alloc.ptr(), i, count);
194194
}
195195

196-
int32_t attribute = 0u;
196+
int32_t attribute = 0;
197197
HIP_CHECK(hipMemRangeGetAttribute(&attribute, sizeof(attribute), GetMemAdviceAttr(advice),
198198
alloc.ptr(), kPageSize));
199199
REQUIRE((advice == hipMemAdviseSetReadMostly ? 1 : device) == attribute);

0 commit comments

Comments
 (0)