DPC++ Runtime
Runtime libraries for oneAPI DPC++
dealloc.hpp
Go to the documentation of this file.
1 //==------------- dealloc.hpp - SYCL annotated usm deallocation ------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
12 #include <sycl/usm.hpp>
13 
14 namespace sycl {
15 inline namespace _V1 {
16 namespace ext {
17 namespace oneapi {
18 namespace experimental {
19 
21 // Deallocation
23 template <typename T, typename propList>
24 void free(annotated_ptr<T, propList> &ptr, const context &syclContext) {
25  sycl::free(ptr.get(), syclContext);
26 }
27 
28 template <typename T, typename propList>
29 void free(annotated_ptr<T, propList> &ptr, const queue &syclQueue) {
30  sycl::free(ptr.get(), syclQueue);
31 }
32 
33 } // namespace experimental
34 } // namespace oneapi
35 } // namespace ext
36 } // namespace _V1
37 } // namespace sycl
The context class represents a SYCL context on which kernel functions may be executed.
Definition: context.hpp:50
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition: queue.hpp:105
void free(annotated_ptr< T, propList > &ptr, const context &syclContext)
Definition: dealloc.hpp:24
void free(void *ptr, const context &ctxt, const detail::code_location &CodeLoc=detail::code_location::current())
Definition: usm_impl.cpp:374
Definition: access.hpp:18