DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
accessor_impl.cpp
Go to the documentation of this file.
1 //==---------------- accessor_impl.cpp - SYCL standard source file ---------==//
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 
11 #include <detail/event_impl.hpp>
13 #include <detail/xpti_registry.hpp>
14 
16 namespace sycl {
17 namespace detail {
18 
19 AccessorImplHost::~AccessorImplHost() {
20  try {
21  if (MBlockedCmd)
22  detail::Scheduler::getInstance().releaseHostAccessor(this);
23  } catch (...) {
24  }
25 }
26 
27 void AccessorImplHost::resize(size_t GlobalSize) {
28  if (GlobalSize != 1) {
29  auto Bufi = static_cast<detail::buffer_impl *>(MSYCLMemObj);
30  MMemoryRange[0] *= GlobalSize;
31  MAccessRange[0] *= GlobalSize;
32  Bufi->resize(MMemoryRange[0] * MElemSize);
33  }
34 }
35 
37  detail::EventImplPtr Event =
38  detail::Scheduler::getInstance().addHostAccessor(Req);
39  Event->wait(Event);
40 }
41 
42 void constructorNotification(void *BufferObj, void *AccessorObj,
45  const detail::code_location &CodeLoc) {
46  XPTIRegistry::bufferAccessorNotification(
47  BufferObj, AccessorObj, (uint32_t)Target, (uint32_t)Mode, CodeLoc);
48 }
49 } // namespace detail
50 } // namespace sycl
51 } // __SYCL_INLINE_NAMESPACE(cl)
event_impl.hpp
xpti_registry.hpp
detail
Definition: pi_opencl.cpp:86
cl::sycl::detail::buffer_impl::resize
void resize(size_t size)
Definition: buffer_impl.hpp:172
cl::sycl::detail::code_location
Definition: common.hpp:54
scheduler.hpp
cl::sycl::detail::buffer_impl
Definition: buffer_impl.hpp:43
cl::sycl::detail::AccessorImplHost
Definition: accessor_impl.hpp:76
cl::sycl::detail::EventImplPtr
std::shared_ptr< detail::event_impl > EventImplPtr
Definition: memory_manager.hpp:31
cl::sycl::access::target
target
Definition: access.hpp:17
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
accessor_impl.hpp
cl::sycl::detail::addHostAccessorAndWait
void addHostAccessorAndWait(Requirement *Req)
Definition: accessor_impl.cpp:36
cl::sycl::access::mode
mode
Definition: access.hpp:28
cl::sycl::detail::constructorNotification
void constructorNotification(void *BufferObj, void *AccessorObj, access::target Target, access::mode Mode, const code_location &CodeLoc)
Definition: accessor_impl.cpp:42
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12
buffer_impl.hpp