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/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
CUdevice
;
25
typedef
struct
CUctx_st *
CUcontext
;
26
typedef
struct
CUstream_st *
CUstream
;
27
typedef
struct
CUevent_st *
CUevent
;
28
typedef
struct
CUmod_st *
CUmodule
;
29
30
// As defined in the CUDA 10.1 header file. This requires CUDA version > 3.2
31
#if defined(_WIN64) || defined(__LP64__)
32
typedef
unsigned
long
long
CUdeviceptr
;
33
#else
34
typedef
unsigned
int
CUdeviceptr
;
35
#endif
36
37
namespace
sycl
{
38
inline
namespace
_V1 {
39
namespace
detail {
40
41
// TODO the interops for context, device, event, platform and program
42
// may be removed after removing the deprecated 'get_native()' methods
43
// from the corresponding classes.
44
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
context
> {
45
using
type
=
CUcontext
;
46
};
47
48
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
device
> {
49
using
type
=
CUdevice
;
50
};
51
52
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
event
> {
53
using
type
=
CUevent
;
54
};
55
56
template
<>
struct
interop
<
backend
::
ext_oneapi_cuda
,
queue
> {
57
using
type
=
CUstream
;
58
};
59
60
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
61
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
62
buffer
<DataT, Dimensions, AllocatorT>> {
63
using
type
=
CUdeviceptr
;
64
};
65
66
template
<
typename
DataT,
int
Dimensions,
typename
AllocatorT>
67
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
68
buffer
<DataT, Dimensions, AllocatorT>> {
69
using
type
=
CUdeviceptr
;
70
};
71
72
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
context
> {
73
using
type
=
CUcontext
;
74
};
75
76
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
context
> {
77
using
type
=
CUcontext
;
78
};
79
80
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
device
> {
81
using
type
=
CUdevice
;
82
};
83
84
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
device
> {
85
using
type
=
CUdevice
;
86
};
87
88
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
event
> {
89
using
type
=
CUevent
;
90
};
91
92
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
event
> {
93
using
type
=
CUevent
;
94
};
95
96
template
<>
struct
BackendInput
<
backend
::
ext_oneapi_cuda
,
queue
> {
97
using
type
=
CUstream
;
98
};
99
100
template
<>
struct
BackendReturn
<
backend
::
ext_oneapi_cuda
,
queue
> {
101
using
type
=
CUstream
;
102
};
103
104
}
// namespace detail
105
}
// namespace _V1
106
}
// namespace sycl
backend_traits.hpp
sycl::_V1::buffer
Defines a shared array that can be used by kernels in queues.
Definition:
buffer.hpp:173
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:50
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:110
context.hpp
CUdeviceptr
unsigned int CUdeviceptr
Definition:
backend_traits_cuda.hpp:34
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, 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, queue >::type
CUstream type
Definition:
backend_traits_cuda.hpp:101
sycl::_V1::detail::BackendReturn
Definition:
backend_traits.hpp:21
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, queue >::type
CUstream type
Definition:
backend_traits_cuda.hpp:57
sycl::_V1::detail::interop
Definition:
backend_traits.hpp:17
device.hpp
include
sycl
detail
backend_traits_cuda.hpp
Generated by
1.9.1