Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit e052442

Browse files
authored
[SYCL] Release specialization constant buffer (#643)
1 parent e120f69 commit e052442

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// REQUIRES: opencl-aot, cpu
2+
3+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/common.cpp -o %t.out \
4+
// RUN: -fsycl-dead-args-optimization
5+
// RUN: env SYCL_PI_TRACE=-1 %CPU_RUN_PLACEHOLDER %t.out | FileCheck %s
6+
7+
#include <sycl/sycl.hpp>
8+
9+
const static sycl::specialization_id<int> SpecConst{42};
10+
11+
int main() {
12+
sycl::queue Q;
13+
Q.submit([&](sycl::handler &CGH) {
14+
CGH.set_specialization_constant<SpecConst>(1);
15+
CGH.single_task<class KernelName>([=](sycl::kernel_handler KH) {
16+
(void)KH.get_specialization_constant<SpecConst>();
17+
});
18+
});
19+
Q.wait();
20+
return 0;
21+
// CHECK: piMemRelease
22+
}

0 commit comments

Comments
 (0)