DPC++ Runtime
Runtime libraries for oneAPI DPC++
backend_traits_hip.hpp
Go to the documentation of this file.
1
//===------- backend_traits_hip.hpp - Backend traits for HIP ---*-C++ -*-===//
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
// This file defines the specializations of the sycl::detail::interop,
10
// sycl::detail::BackendInput and sycl::detail::BackendReturn class templates
11
// for the HIP backend but there is no sycl::detail::InteropFeatureSupportMap
12
// specialization for the HIP backend.
13
//===----------------------------------------------------------------------===//
14
15
#pragma once
16
17
#include <
sycl/context.hpp
>
18
#include <
sycl/detail/backend_traits.hpp
>
19
#include <
sycl/device.hpp
>
20
#include <
sycl/event.hpp
>
21
#include <
sycl/kernel_bundle.hpp
>
22
#include <
sycl/queue.hpp
>
23
24
typedef
int
HIPdevice
;
25
typedef
struct
ihipCtx_t *
HIPcontext
;
26
typedef
struct
ihipStream_t *
HIPstream
;
27
typedef
struct
ihipEvent_t *
HIPevent
;
28
typedef
struct
ihipModule_t *
HIPmodule
;
29
typedef
void
*
HIPdeviceptr
;
30
31
namespace
sycl
{
32
inline
namespace
_V1 {
33
namespace
detail {
34
35
// TODO the interops for context, device, event, platform and program
36
// may be removed after removing the deprecated 'get_native()' methods
37
// from the corresponding classes.
38
template
<>
struct
interop
<
backend
::
ext_oneapi_hip
,
context
> {
39
using
type
=
HIPcontext
;
40
};
41
42
template
<>
struct
interop
<
backend
::
ext_oneapi_hip
,
device
> {
43
using
type
=
HIPdevice
;
44
};
45
46
template
<>
struct
interop
<
backend
::
ext_oneapi_hip
,
event
> {
47
using
type
=
HIPevent
;
48
};
49
50
template
<>
struct
interop
<
backend
::
ext_oneapi_hip
,
queue
> {
51
using
type
=
HIPstream
;
52
};
53
54
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
55
struct
BackendInput
<
backend
::
ext_oneapi_hip
,
56
buffer
<DataT, Dimensions, AllocatorT>> {
57
using
type
=
HIPdeviceptr
;
58
};
59
60
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
61
struct
BackendReturn
<
backend
::
ext_oneapi_hip
,
62
buffer
<DataT, Dimensions, AllocatorT>> {
63
using
type
=
HIPdeviceptr
;
64
};
65
66
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_hip
,
context
> {
67
using
type
=
HIPcontext
;
68
};
69
70
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_hip
,
context
> {
71
using
type
=
HIPcontext
;
72
};
73
74
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_hip
,
device
> {
75
using
type
=
HIPdevice
;
76
};
77
78
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_hip
,
device
> {
79
using
type
=
HIPdevice
;
80
};
81
82
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_hip
,
event
> {
83
using
type
=
HIPevent
;
84
};
85
86
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_hip
,
event
> {
87
using
type
=
HIPevent
;
88
};
89
90
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_hip
,
queue
> {
91
using
type
=
HIPstream
;
92
};
93
94
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_hip
,
queue
> {
95
using
type
=
HIPstream
;
96
};
97
98
template
<>
struct
InteropFeatureSupportMap
<
backend
::
ext_oneapi_hip
> {
99
static
constexpr
bool
MakePlatform
=
false
;
100
static
constexpr
bool
MakeDevice
=
true
;
101
static
constexpr
bool
MakeContext
=
false
;
102
static
constexpr
bool
MakeQueue
=
true
;
103
static
constexpr
bool
MakeEvent
=
true
;
104
static
constexpr
bool
MakeBuffer
=
false
;
105
static
constexpr
bool
MakeKernel
=
false
;
106
static
constexpr
bool
MakeKernelBundle
=
false
;
107
static
constexpr
bool
MakeImage
=
false
;
108
};
109
110
}
// namespace detail
111
}
// namespace _V1
112
}
// namespace sycl
backend_traits.hpp
HIPevent
struct ihipEvent_t * HIPevent
Definition:
backend_traits_hip.hpp:27
HIPmodule
struct ihipModule_t * HIPmodule
Definition:
backend_traits_hip.hpp:28
HIPstream
struct ihipStream_t * HIPstream
Definition:
backend_traits_hip.hpp:26
HIPdeviceptr
void * HIPdeviceptr
Definition:
backend_traits_hip.hpp:29
HIPcontext
struct ihipCtx_t * HIPcontext
Definition:
backend_traits_hip.hpp:25
HIPdevice
int HIPdevice
Definition:
backend_traits_hip.hpp:24
sycl::_V1::buffer
Defines a shared array that can be used by kernels in queues.
Definition:
buffer.hpp:169
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:51
sycl::_V1::device
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition:
device.hpp:64
sycl::_V1::event
An event object can be used to synchronize memory transfers, enqueues of kernels and signaling barrie...
Definition:
event.hpp:44
sycl::_V1::queue
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition:
queue.hpp:111
context.hpp
event.hpp
kernel_bundle.hpp
sycl::_V1::backend
backend
Definition:
backend_types.hpp:18
sycl::_V1::backend::ext_oneapi_hip
@ ext_oneapi_hip
sycl
Definition:
access.hpp:18
queue.hpp
sycl::_V1::detail::BackendInput< backend::ext_oneapi_hip, buffer< DataT, Dimensions, AllocatorT > >::type
HIPdeviceptr type
Definition:
backend_traits_hip.hpp:57
sycl::_V1::detail::BackendInput< backend::ext_oneapi_hip, context >::type
HIPcontext type
Definition:
backend_traits_hip.hpp:67
sycl::_V1::detail::BackendInput< backend::ext_oneapi_hip, device >::type
HIPdevice type
Definition:
backend_traits_hip.hpp:75
sycl::_V1::detail::BackendInput< backend::ext_oneapi_hip, event >::type
HIPevent type
Definition:
backend_traits_hip.hpp:83
sycl::_V1::detail::BackendInput< backend::ext_oneapi_hip, queue >::type
HIPstream type
Definition:
backend_traits_hip.hpp:91
sycl::_V1::detail::BackendInput
Definition:
backend_traits.hpp:19
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_hip, buffer< DataT, Dimensions, AllocatorT > >::type
HIPdeviceptr type
Definition:
backend_traits_hip.hpp:63
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_hip, context >::type
HIPcontext type
Definition:
backend_traits_hip.hpp:71
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_hip, device >::type
HIPdevice type
Definition:
backend_traits_hip.hpp:79
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_hip, event >::type
HIPevent type
Definition:
backend_traits_hip.hpp:87
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_hip, queue >::type
HIPstream type
Definition:
backend_traits_hip.hpp:95
sycl::_V1::detail::BackendReturn
Definition:
backend_traits.hpp:21
sycl::_V1::detail::InteropFeatureSupportMap
Definition:
backend_traits.hpp:23
sycl::_V1::detail::InteropFeatureSupportMap::MakeEvent
static constexpr bool MakeEvent
Definition:
backend_traits.hpp:28
sycl::_V1::detail::InteropFeatureSupportMap::MakeBuffer
static constexpr bool MakeBuffer
Definition:
backend_traits.hpp:29
sycl::_V1::detail::InteropFeatureSupportMap::MakePlatform
static constexpr bool MakePlatform
Definition:
backend_traits.hpp:24
sycl::_V1::detail::InteropFeatureSupportMap::MakeKernel
static constexpr bool MakeKernel
Definition:
backend_traits.hpp:30
sycl::_V1::detail::InteropFeatureSupportMap::MakeContext
static constexpr bool MakeContext
Definition:
backend_traits.hpp:26
sycl::_V1::detail::InteropFeatureSupportMap::MakeQueue
static constexpr bool MakeQueue
Definition:
backend_traits.hpp:27
sycl::_V1::detail::InteropFeatureSupportMap::MakeDevice
static constexpr bool MakeDevice
Definition:
backend_traits.hpp:25
sycl::_V1::detail::InteropFeatureSupportMap::MakeKernelBundle
static constexpr bool MakeKernelBundle
Definition:
backend_traits.hpp:31
sycl::_V1::detail::InteropFeatureSupportMap::MakeImage
static constexpr bool MakeImage
Definition:
backend_traits.hpp:32
sycl::_V1::detail::interop< backend::ext_oneapi_hip, context >::type
HIPcontext type
Definition:
backend_traits_hip.hpp:39
sycl::_V1::detail::interop< backend::ext_oneapi_hip, device >::type
HIPdevice type
Definition:
backend_traits_hip.hpp:43
sycl::_V1::detail::interop< backend::ext_oneapi_hip, event >::type
HIPevent type
Definition:
backend_traits_hip.hpp:47
sycl::_V1::detail::interop< backend::ext_oneapi_hip, queue >::type
HIPstream type
Definition:
backend_traits_hip.hpp:51
sycl::_V1::detail::interop
Definition:
backend_traits.hpp:17
device.hpp
include
sycl
detail
backend_traits_hip.hpp
Generated by
1.9.1