|
| 1 | +// Copyright (C) 2024 Intel Corporation |
| 2 | +// Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. |
| 3 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | + |
| 5 | +#include <umf/memory_provider.h> |
| 6 | +#include <umf/providers/provider_file_memory.h> |
| 7 | +#ifdef UMF_POOL_JEMALLOC_ENABLED |
| 8 | +#include <umf/pools/pool_jemalloc.h> |
| 9 | +#endif |
| 10 | +#ifdef UMF_POOL_SCALABLE_ENABLED |
| 11 | +#include <umf/pools/pool_scalable.h> |
| 12 | +#endif |
| 13 | + |
| 14 | +#include "ipcFixtures.hpp" |
| 15 | + |
| 16 | +using umf_test::test; |
| 17 | + |
| 18 | +#define FILE_PATH ((char *)"tmp_file") |
| 19 | + |
| 20 | +umf_file_memory_provider_params_t get_file_params_shared(char *path) { |
| 21 | + umf_file_memory_provider_params_t file_params = |
| 22 | + umfFileMemoryProviderParamsDefault(path); |
| 23 | + file_params.visibility = UMF_MEM_MAP_SHARED; |
| 24 | + return file_params; |
| 25 | +} |
| 26 | + |
| 27 | +umf_file_memory_provider_params_t file_params_shared = |
| 28 | + get_file_params_shared(FILE_PATH); |
| 29 | + |
| 30 | +HostMemoryAccessor hostAccessor; |
| 31 | + |
| 32 | +static std::vector<ipcTestParams> ipcManyPoolsTestParamsList = { |
| 33 | +// TODO: enable it when sizes of allocations in ipcFixtures.hpp are fixed |
| 34 | +// {umfProxyPoolOps(), nullptr, umfFileMemoryProviderOps(), |
| 35 | +// &file_params_shared, &hostAccessor, true}, |
| 36 | +#ifdef UMF_POOL_JEMALLOC_ENABLED |
| 37 | + {umfJemallocPoolOps(), nullptr, umfFileMemoryProviderOps(), |
| 38 | + &file_params_shared, &hostAccessor, false}, |
| 39 | +#endif |
| 40 | +#ifdef UMF_POOL_SCALABLE_ENABLED |
| 41 | + {umfScalablePoolOps(), nullptr, umfFileMemoryProviderOps(), |
| 42 | + &file_params_shared, &hostAccessor, false}, |
| 43 | +#endif |
| 44 | +}; |
| 45 | + |
| 46 | +GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(umfIpcTest); |
| 47 | + |
| 48 | +INSTANTIATE_TEST_SUITE_P(FileProviderDifferentPoolsTest, umfIpcTest, |
| 49 | + ::testing::ValuesIn(ipcManyPoolsTestParamsList)); |
0 commit comments