Skip to content

Commit 96f8844

Browse files
committed
use Base Alloc in tests to fix Proxy Lib scenarios
1 parent e53e52f commit 96f8844

File tree

4 files changed

+11
-76
lines changed

4 files changed

+11
-76
lines changed

.github/workflows/pr_push.yml

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -16,75 +16,6 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
DocsBuild:
22-
uses: ./.github/workflows/reusable_docs_build.yml
23-
FastBuild:
24-
name: Fast builds
25-
needs: [CodeChecks, DocsBuild]
26-
uses: ./.github/workflows/reusable_fast.yml
27-
Build:
28-
name: Basic builds
29-
needs: [FastBuild]
30-
uses: ./.github/workflows/reusable_basic.yml
31-
DevDax:
32-
needs: [FastBuild]
33-
uses: ./.github/workflows/reusable_dax.yml
34-
MultiNuma:
35-
needs: [FastBuild]
36-
uses: ./.github/workflows/reusable_multi_numa.yml
37-
L0:
38-
needs: [Build]
39-
uses: ./.github/workflows/reusable_gpu.yml
40-
with:
41-
name: "LEVEL_ZERO"
42-
shared_lib: "['ON']"
43-
CUDA:
44-
needs: [Build]
45-
uses: ./.github/workflows/reusable_gpu.yml
46-
with:
47-
name: "CUDA"
48-
shared_lib: "['ON']"
49-
Sanitizers:
50-
needs: [FastBuild]
51-
uses: ./.github/workflows/reusable_sanitizers.yml
52-
QEMU:
53-
needs: [FastBuild]
54-
uses: ./.github/workflows/reusable_qemu.yml
55-
with:
56-
short_run: true
57-
Benchmarks:
58-
needs: [Build]
59-
uses: ./.github/workflows/reusable_benchmarks.yml
6019
ProxyLib:
61-
needs: [Build]
6220
uses: ./.github/workflows/reusable_proxy_lib.yml
63-
Valgrind:
64-
needs: [Build]
65-
uses: ./.github/workflows/reusable_valgrind.yml
66-
Coverage:
67-
# total coverage (on upstream only)
68-
if: github.repository == 'oneapi-src/unified-memory-framework'
69-
needs: [Build, DevDax, L0, CUDA, MultiNuma, QEMU, ProxyLib]
70-
uses: ./.github/workflows/reusable_coverage.yml
71-
secrets: inherit
72-
with:
73-
trigger: "${{github.event_name}}"
74-
Coverage_partial:
75-
# partial coverage (on forks)
76-
if: github.repository != 'oneapi-src/unified-memory-framework'
77-
needs: [Build, QEMU, ProxyLib]
78-
uses: ./.github/workflows/reusable_coverage.yml
79-
CodeQL:
80-
needs: [Build]
81-
permissions:
82-
contents: read
83-
security-events: write
84-
uses: ./.github/workflows/reusable_codeql.yml
85-
Trivy:
86-
needs: [Build]
87-
permissions:
88-
contents: read
89-
security-events: write
90-
uses: ./.github/workflows/reusable_trivy.yml
21+

.github/workflows/reusable_proxy_lib.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
working-directory: ${{env.BUILD_DIR}}
6666
run: LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure -E provider_file_memory_ipc
6767

68+
- name: aaa
69+
working-directory: ${{env.BUILD_DIR}}
70+
run: UMF_LOG="level:debug;flush:debug;output:stderr;pid:no" LD_PRELOAD=./lib/libumf_proxy.so ctest --output-on-failure -R disjointPool
71+
6872
- name: Run "./test/umf_test-memoryPool" with proxy library
6973
working-directory: ${{env.BUILD_DIR}}
7074
run: LD_PRELOAD=./lib/libumf_proxy.so ./test/umf_test-memoryPool

test/memoryPoolAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ TEST_F(test, getLastFailedMemoryProvider) {
284284

285285
umf_result_t alloc(size_t size, size_t, void **ptr) noexcept {
286286
if (allocResult == UMF_RESULT_SUCCESS) {
287-
*ptr = malloc(size);
287+
*ptr = umf_ba_global_alloc(size);
288288
} else {
289289
*ptr = nullptr;
290290
}
@@ -293,7 +293,7 @@ TEST_F(test, getLastFailedMemoryProvider) {
293293
}
294294

295295
umf_result_t free(void *ptr, [[maybe_unused]] size_t size) noexcept {
296-
::free(ptr);
296+
umf_ba_global_free(ptr);
297297
return UMF_RESULT_SUCCESS;
298298
}
299299

test/pools/disjoint_pool.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ TEST_F(test, freeErrorPropagation) {
5757
static umf_result_t expectedResult = UMF_RESULT_SUCCESS;
5858
struct memory_provider : public umf_test::provider_base_t {
5959
umf_result_t alloc(size_t size, size_t, void **ptr) noexcept {
60-
*ptr = malloc(size);
60+
*ptr = umf_ba_global_alloc(size);
6161
return UMF_RESULT_SUCCESS;
6262
}
6363

6464
umf_result_t free(void *ptr, [[maybe_unused]] size_t size) noexcept {
6565
// do the actual free only when we expect the success
6666
if (expectedResult == UMF_RESULT_SUCCESS) {
67-
::free(ptr);
67+
umf_ba_global_free(ptr);
6868
}
6969
return expectedResult;
7070
}
@@ -110,12 +110,12 @@ TEST_F(test, sharedLimits) {
110110

111111
struct memory_provider : public umf_test::provider_base_t {
112112
umf_result_t alloc(size_t size, size_t, void **ptr) noexcept {
113-
*ptr = malloc(size);
113+
*ptr = umf_ba_global_alloc(size);
114114
numAllocs++;
115115
return UMF_RESULT_SUCCESS;
116116
}
117117
umf_result_t free(void *ptr, [[maybe_unused]] size_t size) noexcept {
118-
::free(ptr);
118+
umf_ba_global_free(ptr);
119119
numFrees++;
120120
return UMF_RESULT_SUCCESS;
121121
}

0 commit comments

Comments
 (0)