-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathdpctl_sycl_platform_interface.h
More file actions
145 lines (131 loc) · 4.52 KB
/
Copy pathdpctl_sycl_platform_interface.h
File metadata and controls
145 lines (131 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
//===-- dpctl_sycl_platform_interface.h - C API for sycl::platform -*-C++-*- =//
//
// Data Parallel Control (dpctl)
//
// Copyright 2020-2021 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This header declares a C interface to sycl::platform interface functions.
///
//===----------------------------------------------------------------------===//
#pragma once
#include "Support/DllExport.h"
#include "Support/ExternC.h"
#include "Support/MemOwnershipAttrs.h"
#include "dpctl_data_types.h"
#include "dpctl_sycl_enum_types.h"
#include "dpctl_sycl_platform_manager.h"
#include "dpctl_sycl_types.h"
DPCTL_C_EXTERN_C_BEGIN
/**
* @defgroup PlatformInterface Platform class C wrapper
*/
/*!
* @brief Returns a copy of the DPCTLSyclPlatformRef object.
*
* @param PRef DPCTLSyclPlatformRef object to be copied.
* @return A new DPCTLSyclPlatformRef created by copying the passed in
* DPCTLSyclPlatformRef object.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_Copy(__dpctl_keep const DPCTLSyclPlatformRef PRef);
/*!
* @brief Creates a new DPCTLSyclPlatformRef for a SYCL platform constructed
* using SYCL's default_selector.
*
* @return A new DPCTLSyclPlatformRef pointer wrapping a SYCL platform object.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_Create(void);
/*!
* @brief Creates a new DPCTLSyclPlatformRef for a SYCL platform constructed
* using the device_selector wrapped by DPCTLSyclDeviceSelectorRef.
*
* @param DSRef An opaque pointer to a SYCL device_selector object.
* @return A new DPCTLSyclPlatformRef pointer wrapping a SYCL platform object.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give DPCTLSyclPlatformRef DPCTLPlatform_CreateFromSelector(
__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef);
/*!
* @brief Deletes the DPCTLSyclProgramRef pointer.
*
* @param PRef An opaque pointer to a sycl::platform.
* @ingroup PlatformInterface
*/
DPCTL_API
void DPCTLPlatform_Delete(__dpctl_take DPCTLSyclPlatformRef PRef);
/*!
* @brief Returns a DPCTLSyclBackendType enum value identifying the SYCL
* backend associated with the platform.
*
* @param PRef Opaque pointer to a sycl::platform
* @return A DPCTLSyclBackendType enum value identifying the SYCL backend
* associated with the platform.
* @ingroup PlatformInterface
*/
DPCTL_API
DPCTLSyclBackendType
DPCTLPlatform_GetBackend(__dpctl_keep const DPCTLSyclPlatformRef PRef);
/*!
* @brief Returns a C string for the platform name.
*
* @param PRef Opaque pointer to a sycl::platform
* @return A C string containing the name of the sycl::platform.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLPlatform_GetName(__dpctl_keep const DPCTLSyclPlatformRef PRef);
/*!
* @brief Returns a C string corresponding to the vendor providing the platform.
*
* @param PRef Opaque pointer to a sycl::platform
* @return A C string containing the name of the vendor provifing the
* platform.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLPlatform_GetVendor(__dpctl_keep const DPCTLSyclPlatformRef PRef);
/*!
* @brief Returns the software driver version of the sycl::platform as a C
* string.
*
* @param PRef Opaque pointer to a sycl::platform
* @return A C string containing the software driver version of the device
* associated with the platform.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give const char *
DPCTLPlatform_GetVersion(__dpctl_keep const DPCTLSyclPlatformRef PRef);
/*!
* @brief Returns an opaque pointer to a vector of SYCL platforms available on
* the system.
*
* @return A #DPCTLPlatformVectorRef containing #DPCTLSyclPlatformRef
* objects.
* @ingroup PlatformInterface
*/
DPCTL_API
__dpctl_give DPCTLPlatformVectorRef DPCTLPlatform_GetPlatforms(void);
DPCTL_C_EXTERN_C_END