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

[SYCL] Release specialization constant buffer #643

Merged
merged 14 commits into from
Dec 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions SYCL/SpecConstants/2020/non_native/SpecConstBuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// REQUIRES: opencl-aot, cpu

// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/common.cpp -o %t.out \
// RUN: -fsycl-dead-args-optimization
// RUN: env SYCL_PI_TRACE=-1 %CPU_RUN_PLACEHOLDER %t.out | FileCheck %s

#include <sycl/sycl.hpp>

const static sycl::specialization_id<int> SpecConst{42};

int main() {
sycl::queue Q;
Q.submit([&](sycl::handler &CGH) {
CGH.set_specialization_constant<SpecConst>(1);
CGH.single_task<class KernelName>([=](sycl::kernel_handler KH) {
(void)KH.get_specialization_constant<SpecConst>();
});
});
Q.wait();
return 0;
// CHECK: piMemRelease
}