Skip to content

Commit e03fedc

Browse files
committed
Add indirect access memory stress test
Signed-off-by: Oskar Hubert Weber <[email protected]>
1 parent ed16a93 commit e03fedc

File tree

4 files changed

+216
-53
lines changed

4 files changed

+216
-53
lines changed

stress_tests/common/src/stress_common_func.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2019-2023 Intel Corporation
3+
* Copyright (C) 2019-2025 Intel Corporation
44
*
55
* SPDX-License-Identifier: MIT
66
*
@@ -43,7 +43,7 @@ uint64_t total_available_host_memory() {
4343
stat.dwLength = sizeof(stat);
4444
GlobalMemoryStatusEx(&stat);
4545

46-
return stat.ullAvailVirtual;
46+
return stat.ullAvailPhys;
4747
}
4848
uint64_t get_page_size() {
4949
SYSTEM_INFO si;

stress_tests/test_memory_allocation/kernels/test_multiple_memory_allocations.cl

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2019 Intel Corporation
3+
* Copyright (C) 2019-2025 Intel Corporation
44
*
55
* SPDX-License-Identifier: MIT
66
*
@@ -86,3 +86,78 @@ kernel void test_device_memory10_unit_size4(__global uint *src, __global uint *d
8686
size_t tid = get_global_id(0);
8787
dst[tid] = src[tid];
8888
}
89+
90+
struct buffer {
91+
uint *data;
92+
};
93+
94+
kernel void test_device_memory1_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
95+
uint *src = src_ptrs[dispatch_id].data;
96+
uint *dst = dst_ptrs[dispatch_id].data;
97+
size_t tid = get_global_id(0);
98+
dst[tid] = src[tid];
99+
}
100+
101+
kernel void test_device_memory2_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
102+
uint *src = src_ptrs[dispatch_id].data;
103+
uint *dst = dst_ptrs[dispatch_id].data;
104+
size_t tid = get_global_id(0);
105+
dst[tid] = src[tid];
106+
}
107+
108+
kernel void test_device_memory3_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
109+
uint *src = src_ptrs[dispatch_id].data;
110+
uint *dst = dst_ptrs[dispatch_id].data;
111+
size_t tid = get_global_id(0);
112+
dst[tid] = src[tid];
113+
}
114+
115+
kernel void test_device_memory4_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
116+
uint *src = src_ptrs[dispatch_id].data;
117+
uint *dst = dst_ptrs[dispatch_id].data;
118+
size_t tid = get_global_id(0);
119+
dst[tid] = src[tid];
120+
}
121+
122+
kernel void test_device_memory5_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
123+
uint *src = src_ptrs[dispatch_id].data;
124+
uint *dst = dst_ptrs[dispatch_id].data;
125+
size_t tid = get_global_id(0);
126+
dst[tid] = src[tid];
127+
}
128+
129+
kernel void test_device_memory6_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
130+
uint *src = src_ptrs[dispatch_id].data;
131+
uint *dst = dst_ptrs[dispatch_id].data;
132+
size_t tid = get_global_id(0);
133+
dst[tid] = src[tid];
134+
}
135+
136+
kernel void test_device_memory7_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
137+
uint *src = src_ptrs[dispatch_id].data;
138+
uint *dst = dst_ptrs[dispatch_id].data;
139+
size_t tid = get_global_id(0);
140+
dst[tid] = src[tid];
141+
}
142+
143+
kernel void test_device_memory8_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
144+
uint *src = src_ptrs[dispatch_id].data;
145+
uint *dst = dst_ptrs[dispatch_id].data;
146+
size_t tid = get_global_id(0);
147+
dst[tid] = src[tid];
148+
}
149+
150+
kernel void test_device_memory9_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
151+
uint *src = src_ptrs[dispatch_id].data;
152+
uint *dst = dst_ptrs[dispatch_id].data;
153+
size_t tid = get_global_id(0);
154+
dst[tid] = src[tid];
155+
}
156+
157+
kernel void test_device_memory10_indirect(__global struct buffer *src_ptrs, __global struct buffer *dst_ptrs, uint dispatch_id) {
158+
uint *src = src_ptrs[dispatch_id].data;
159+
uint *dst = dst_ptrs[dispatch_id].data;
160+
size_t tid = get_global_id(0);
161+
dst[tid] = src[tid];
162+
}
163+
Binary file not shown.

0 commit comments

Comments
 (0)