Skip to content

Commit 0a4f4c7

Browse files
committed
test to expose zeVirtualMemQueryPageSize not using allocation size
1 parent 11ccf62 commit 0a4f4c7

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7+
8+
#define GRAPH_E2E_EXPLICIT
9+
10+
#include "../Inputs/async_alloc_different_sizes.cpp"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Tests queries associated with graph-owned allocations
2+
3+
#include "../../graph_common.hpp"
4+
#include <sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp>
5+
6+
void asyncAllocWorksWithSize(size_t Size) {
7+
queue Queue{};
8+
9+
exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};
10+
11+
void *AsyncPtr = nullptr;
12+
// Add alloc node
13+
auto AllocNode = add_node(Graph, Queue, [&](handler &CGH) {
14+
AsyncPtr = exp_ext::async_malloc(CGH, usm::alloc::device, Size);
15+
});
16+
17+
add_node(
18+
Graph, Queue,
19+
[&](handler &CGH) {
20+
depends_on_helper(CGH, AllocNode);
21+
exp_ext::async_free(CGH, AsyncPtr);
22+
},
23+
AllocNode);
24+
25+
auto GraphExec = Graph.finalize();
26+
}
27+
28+
int main() {
29+
asyncAllocWorksWithSize(1);
30+
asyncAllocWorksWithSize(131);
31+
asyncAllocWorksWithSize(10071);
32+
asyncAllocWorksWithSize(1007177);
33+
//asyncAllocWorksWithSize(191439360); // BUG
34+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %{build} -o %t.out
2+
// RUN: %{run} %t.out
3+
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG
4+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
5+
// Extra run to check for immediate-command-list in Level Zero
6+
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %}
7+
8+
#define GRAPH_E2E_RECORD_REPLAY
9+
10+
#include "../Inputs/async_alloc_queries.cpp"

0 commit comments

Comments
 (0)