DPC++ Runtime
Runtime libraries for oneAPI DPC++
mem_alloc_helper.hpp
Go to the documentation of this file.
1 //==-------- mem_alloc_helper.hpp - SYCL mem alloc helper ------------------==//
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 
11 #include <sycl/detail/pi.h>
12 
13 namespace sycl {
15 namespace detail {
16 void memBufferCreateHelper(const plugin &Plugin, pi_context Ctx,
17  pi_mem_flags Flags, size_t Size, void *HostPtr,
18  pi_mem *RetMem,
19  const pi_mem_properties *Props = nullptr);
20 void memReleaseHelper(const plugin &Plugin, pi_mem Mem);
21 void memBufferMapHelper(const plugin &Plugin, pi_queue command_queue,
22  pi_mem buffer, pi_bool blocking_map,
23  pi_map_flags map_flags, size_t offset, size_t size,
24  pi_uint32 num_events_in_wait_list,
25  const pi_event *event_wait_list, pi_event *event,
26  void **ret_map);
27 void memUnmapHelper(const plugin &Plugin, pi_queue command_queue, pi_mem memobj,
28  void *mapped_ptr, pi_uint32 num_events_in_wait_list,
29  const pi_event *event_wait_list, pi_event *event);
30 } // namespace detail
31 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
32 } // namespace sycl
#define __SYCL_INLINE_VER_NAMESPACE(X)
void memBufferCreateHelper(const plugin &Plugin, pi_context Ctx, pi_mem_flags Flags, size_t Size, void *HostPtr, pi_mem *RetMem, const pi_mem_properties *Props=nullptr)
void memUnmapHelper(const plugin &Plugin, pi_queue command_queue, pi_mem memobj, void *mapped_ptr, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event)
void memReleaseHelper(const plugin &Plugin, pi_mem Mem)
void memBufferMapHelper(const plugin &Plugin, pi_queue command_queue, pi_mem buffer, pi_bool blocking_map, pi_map_flags map_flags, size_t offset, size_t size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event, void **ret_map)
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
pi_bitfield pi_map_flags
Definition: pi.h:552
pi_uint32 pi_bool
Definition: pi.h:105
pi_bitfield pi_mem_properties
Definition: pi.h:558
uint32_t pi_uint32
Definition: pi.h:103
pi_bitfield pi_mem_flags
Definition: pi.h:542
PI context mapping to a CUDA context object.
Definition: pi_cuda.hpp:160
PI Event mapping to CUevent.
Definition: pi_cuda.hpp:608
PI Mem mapping to CUDA memory allocations, both data and texture/surface.
Definition: pi_cuda.hpp:222
PI queue mapping on to CUstream objects.
Definition: pi_cuda.hpp:393