DPC++ Runtime
Runtime libraries for oneAPI DPC++
enqueue_functions.cpp
Go to the documentation of this file.
1 //==------ enqueue_functions.hpp ------- SYCL enqueue free functions -------==//
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 #include <detail/queue_impl.hpp>
11 
12 namespace sycl {
13 inline namespace _V1 {
14 namespace ext::oneapi::experimental {
15 
16 __SYCL_EXPORT void memcpy(queue Q, void *Dest, const void *Src, size_t NumBytes,
17  const sycl::detail::code_location &CodeLoc) {
18  sycl::detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
20  QueueImplPtr->memcpy(QueueImplPtr, Dest, Src, NumBytes, {},
21  /*CallerNeedsEvent=*/false, CodeLoc);
22 }
23 
24 __SYCL_EXPORT void memset(queue Q, void *Ptr, int Value, size_t NumBytes,
25  const sycl::detail::code_location &CodeLoc) {
26  sycl::detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
28  QueueImplPtr->memset(QueueImplPtr, Ptr, Value, NumBytes, {},
29  /*CallerNeedsEvent=*/false);
30 }
31 
32 __SYCL_EXPORT void mem_advise(queue Q, void *Ptr, size_t NumBytes, int Advice,
33  const sycl::detail::code_location &CodeLoc) {
34  sycl::detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
36  QueueImplPtr->mem_advise(QueueImplPtr, Ptr, NumBytes,
37  ur_usm_advice_flags_t(Advice), {},
38  /*CallerNeedsEvent=*/false);
39 }
40 
41 } // namespace ext::oneapi::experimental
42 } // namespace _V1
43 } // namespace sycl
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition: queue.hpp:110
decltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
Definition: impl_utils.hpp:31
std::shared_ptr< sycl::detail::queue_impl > QueueImplPtr
Definition: helpers.hpp:45
void mem_advise(handler &CGH, void *Ptr, size_t NumBytes, int Advice)
void memcpy(handler &CGH, void *Dest, const void *Src, size_t NumBytes)
void memset(handler &CGH, void *Ptr, int Value, size_t NumBytes)
Definition: access.hpp:18