DPC++ Runtime
Runtime libraries for oneAPI DPC++
backend_traits_cuda.hpp
Go to the documentation of this file.
1
//===------- backend_traits_cuda.hpp - Backend traits for CUDA ---*-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 CUDA backend but there is no sycl::detail::InteropFeatureSupportMap
12
// specialization for the CUDA backend.
13
//===----------------------------------------------------------------------===//
14
15
#pragma once
16
17
#include <
sycl/accessor.hpp
>
18
#include <
sycl/context.hpp
>
19
#include <
sycl/detail/backend_traits.hpp
>
20
#include <
sycl/device.hpp
>
21
#include <
sycl/event.hpp
>
22
#include <
sycl/kernel_bundle.hpp
>
23
#include <
sycl/queue.hpp
>
24
25
#include <vector>
26
27
typedef
int
CUdevice
;
28
typedef
struct
CUctx_st *
CUcontext
;
29
typedef
struct
CUstream_st *
CUstream
;
30
typedef
struct
CUevent_st *
CUevent
;
31
typedef
struct
CUmod_st *
CUmodule
;
32
33
namespace
sycl
{
34
inline
namespace
_V1 {
35
namespace
detail {
36
37
// TODO the interops for context, device, event, platform and program
38
// may be removed after removing the deprecated 'get_native()' methods
39
// from the corresponding classes. The interop<backend, queue> specialization
40
// is also used in the get_queue() method of the deprecated class
41
// interop_handler and also can be removed after API cleanup.
42
template
<>
struct
interop<
backend
::ext_oneapi_cuda, context> {
43
using
type
=
CUcontext
;
44
};
45
46
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
device
> {
47
using
type
=
CUdevice
;
48
};
49
50
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
event
> {
51
using
type
=
CUevent
;
52
};
53
54
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
queue
> {
55
using
type
=
CUstream
;
56
};
57
58
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
platform
> {
59
using
type
= std::vector<CUdevice>;
60
};
61
62
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
63
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
64
buffer
<DataT, Dimensions, AllocatorT>> {
65
using
type
= DataT *;
66
};
67
68
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
69
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
70
buffer
<DataT, Dimensions, AllocatorT>> {
71
using
type
= DataT *;
72
};
73
74
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
context
> {
75
using
type
=
CUcontext
;
76
};
77
78
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
context
> {
79
using
type
= std::vector<CUcontext>;
80
};
81
82
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
device
> {
83
using
type
=
CUdevice
;
84
};
85
86
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
device
> {
87
using
type
=
CUdevice
;
88
};
89
90
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
event
> {
91
using
type
=
CUevent
;
92
};
93
94
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
event
> {
95
using
type
=
CUevent
;
96
};
97
98
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
queue
> {
99
using
type
=
CUstream
;
100
};
101
102
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
queue
> {
103
using
type
=
CUstream
;
104
};
105
106
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
platform
> {
107
using
type
= std::vector<CUdevice>;
108
};
109
110
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
platform
> {
111
using
type
= std::vector<CUdevice>;
112
};
113
114
template
<>
struct
InteropFeatureSupportMap
<
backend
::
ext_oneapi_cuda
> {
115
static
constexpr
bool
MakePlatform
=
false
;
116
static
constexpr
bool
MakeDevice
=
true
;
117
static
constexpr
bool
MakeContext
=
false
;
118
static
constexpr
bool
MakeQueue
=
true
;
119
static
constexpr
bool
MakeEvent
=
true
;
120
static
constexpr
bool
MakeBuffer
=
false
;
121
static
constexpr
bool
MakeKernel
=
false
;
122
static
constexpr
bool
MakeKernelBundle
=
false
;
123
static
constexpr
bool
MakeImage
=
false
;
124
};
125
126
}
// namespace detail
127
}
// namespace _V1
128
}
// namespace sycl
accessor.hpp
The file contains implementations of accessor class.
backend_traits.hpp
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:66
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::platform
Encapsulates a SYCL platform on which kernels may be executed.
Definition:
platform.hpp:109
sycl::_V1::queue
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition:
queue.hpp:119
context.hpp
CUevent
struct CUevent_st * CUevent
Definition:
backend_traits_cuda.hpp:27
CUmodule
struct CUmod_st * CUmodule
Definition:
backend_traits_cuda.hpp:28
CUstream
struct CUstream_st * CUstream
Definition:
backend_traits_cuda.hpp:26
CUdevice
int CUdevice
Definition:
backend_traits_cuda.hpp:24
CUcontext
struct CUctx_st * CUcontext
Definition:
backend_traits_cuda.hpp:25
event.hpp
kernel_bundle.hpp
sycl::_V1::backend
backend
Definition:
backend_types.hpp:18
sycl::_V1::backend::ext_oneapi_cuda
@ ext_oneapi_cuda
sycl
Definition:
access.hpp:18
queue.hpp
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, buffer< DataT, Dimensions, AllocatorT > >::type
CUdeviceptr type
Definition:
backend_traits_cuda.hpp:63
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, context >::type
CUcontext type
Definition:
backend_traits_cuda.hpp:73
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, device >::type
CUdevice type
Definition:
backend_traits_cuda.hpp:81
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, event >::type
CUevent type
Definition:
backend_traits_cuda.hpp:89
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, platform >::type
std::vector< CUdevice > type
Definition:
backend_traits_cuda.hpp:107
sycl::_V1::detail::BackendInput< backend::ext_oneapi_cuda, queue >::type
CUstream type
Definition:
backend_traits_cuda.hpp:97
sycl::_V1::detail::BackendInput
Definition:
backend_traits.hpp:19
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, buffer< DataT, Dimensions, AllocatorT > >::type
CUdeviceptr type
Definition:
backend_traits_cuda.hpp:69
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, context >::type
CUcontext type
Definition:
backend_traits_cuda.hpp:77
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, device >::type
CUdevice type
Definition:
backend_traits_cuda.hpp:85
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, event >::type
CUevent type
Definition:
backend_traits_cuda.hpp:93
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, platform >::type
std::vector< CUdevice > type
Definition:
backend_traits_cuda.hpp:111
sycl::_V1::detail::BackendReturn< backend::ext_oneapi_cuda, queue >::type
CUstream type
Definition:
backend_traits_cuda.hpp:101
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_cuda, context >::type
CUcontext type
Definition:
backend_traits_cuda.hpp:45
sycl::_V1::detail::interop< backend::ext_oneapi_cuda, device >::type
CUdevice type
Definition:
backend_traits_cuda.hpp:49
sycl::_V1::detail::interop< backend::ext_oneapi_cuda, event >::type
CUevent type
Definition:
backend_traits_cuda.hpp:53
sycl::_V1::detail::interop< backend::ext_oneapi_cuda, platform >::type
std::vector< CUdevice > type
Definition:
backend_traits_cuda.hpp:59
sycl::_V1::detail::interop< backend::ext_oneapi_cuda, queue >::type
CUstream type
Definition:
backend_traits_cuda.hpp:57
sycl::_V1::detail::interop
Definition:
backend_traits.hpp:17
device.hpp
include
sycl
ext
oneapi
experimental
backend
backend_traits_cuda.hpp
Generated by
1.9.1