Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test/common/level_zero_mocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices(
ze_device_handle_t device, std::vector<ze_device_handle_t> residentDevices,
ze_context_handle_t context, ze_device_properties_t device_properties,
ze_memory_allocation_properties_t memory_allocation_properties) {

umf_level_zero_memory_provider_params_handle_t params = nullptr;
EXPECT_EQ(umfLevelZeroMemoryProviderParamsCreate(&params),
UMF_RESULT_SUCCESS);
Expand All @@ -31,10 +32,10 @@ LevelZeroMock::initializeMemoryProviderWithResidentDevices(
EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetMemoryType(
params, UMF_MEMORY_TYPE_DEVICE),
UMF_RESULT_SUCCESS);

EXPECT_EQ(umfLevelZeroMemoryProviderParamsSetResidentDevices(
params, residentDevices.data(), residentDevices.size()),
UMF_RESULT_SUCCESS);
EXPECT_EQ(
umfLevelZeroMemoryProviderParamsSetResidentDevices(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: maybe this function should accept size_t instead of uint32_t - i think other functions in UMF uses size_t in similar places

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not consistent here - this was missed in API 1.0 review :( e.g.

umf_result_t umfOsMemoryProviderParamsSetNumaList(
    umf_os_memory_provider_params_handle_t hParams, unsigned *numa_list,
    unsigned numa_list_len);

params, residentDevices.data(), (uint32_t)residentDevices.size()),
UMF_RESULT_SUCCESS);

// query min page size operation upon provider initialization
EXPECT_CALL(*this, zeDeviceGetProperties(device, _))
Expand Down
8 changes: 8 additions & 0 deletions test/pools/pool_residency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include "pool.hpp"
#include "gtest/gtest.h"

// On MSVC disable C6285 warning produced by gtest:
// (<non-zero constant> || <non-zero constant>) is always a non-zero constant.
// Did you intend to use the bitwise-and operator?
#ifdef _MSC_VER
#pragma warning(disable : 6285)
#endif

using namespace testing;

class PoolResidencyTestFixture : public Test {
Expand Down Expand Up @@ -53,6 +60,7 @@ TEST_F(PoolResidencyTestFixture,
EXPECT_CALL(l0mock, zeMemAllocDevice(CONTEXT, _, _, _, OUR_DEVICE, _))
.WillOnce(
DoAll(SetArgPointee<5>(POINTER_0), Return(ZE_RESULT_SUCCESS)));

EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_0, _, _))
.WillOnce(Return(ZE_RESULT_SUCCESS));
EXPECT_CALL(l0mock, zeContextMakeMemoryResident(CONTEXT, DEVICE_1, _, _))
Expand Down