File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 3030#include " Support/MemOwnershipAttrs.h"
3131#include " dpctl_data_types.h"
3232#include " dpctl_sycl_enum_types.h"
33+ #include " dpctl_sycl_types.h"
3334
3435DPCTL_C_EXTERN_C_BEGIN
3536
37+ /* !
38+ * @brief Deletes the DPCTLSyclProgramRef pointer.
39+ *
40+ * @param PRef An opaque pointer to a sycl::platform.
41+ */
42+ DPCTL_API
43+ void DPCTLPlatform_Delete (__dpctl_take DPCTLSyclPlatformRef PRef);
44+
3645/* !
3746 * @brief Returns the number of non-host type sycl::platform available on the
3847 * system.
Original file line number Diff line number Diff line change 2626
2727#include " dpctl_sycl_platform_interface.h"
2828#include " ../helper/include/dpctl_utils_helper.h"
29+ #include " Support/CBindingWrapping.h"
2930#include < CL/sycl.hpp>
3031#include < iomanip>
3132#include < iostream>
@@ -36,6 +37,9 @@ using namespace cl::sycl;
3637
3738namespace
3839{
40+
41+ DEFINE_SIMPLE_CONVERSION_FUNCTIONS (platform, DPCTLSyclPlatformRef);
42+
3943std::set<DPCTLSyclBackendType> get_set_of_non_hostbackends ()
4044{
4145 std::set<DPCTLSyclBackendType> be_set;
@@ -64,6 +68,12 @@ std::set<DPCTLSyclBackendType> get_set_of_non_hostbackends()
6468
6569} // namespace
6670
71+ void DPCTLPlatform_Delete (__dpctl_take DPCTLSyclPlatformRef PRef)
72+ {
73+ auto P = unwrap (PRef);
74+ delete P;
75+ }
76+
6777/* !
6878 * Prints out the following sycl::info::platform attributes for each platform
6979 * found on the system:
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ cdef extern from "dpctl_sycl_types.h":
7575 cdef struct DPCTLOpaqueSyclDeviceSelector
7676 cdef struct DPCTLOpaqueSyclEvent
7777 cdef struct DPCTLOpaqueSyclKernel
78+ cdef struct DPCTLOpaqueSyclPlatform
7879 cdef struct DPCTLOpaqueSyclProgram
7980 cdef struct DPCTLOpaqueSyclQueue
8081 cdef struct DPCTLOpaqueSyclUSM
@@ -84,6 +85,7 @@ cdef extern from "dpctl_sycl_types.h":
8485 ctypedef DPCTLOpaqueSyclDeviceSelector * DPCTLSyclDeviceSelectorRef
8586 ctypedef DPCTLOpaqueSyclEvent * DPCTLSyclEventRef
8687 ctypedef DPCTLOpaqueSyclKernel * DPCTLSyclKernelRef
88+ ctypedef DPCTLOpaqueSyclPlatform * DPCTLSyclPlatformRef
8789 ctypedef DPCTLOpaqueSyclProgram * DPCTLSyclProgramRef
8890 ctypedef DPCTLOpaqueSyclQueue * DPCTLSyclQueueRef
8991 ctypedef DPCTLOpaqueSyclUSM * DPCTLSyclUSMRef
@@ -138,6 +140,7 @@ cdef extern from "dpctl_sycl_kernel_interface.h":
138140
139141
140142cdef extern from " dpctl_sycl_platform_interface.h" :
143+ cdef void DPCTLPlatform_Delete()
141144 cdef size_t DPCTLPlatform_GetNumNonHostPlatforms()
142145 cdef void DPCTLPlatform_DumpInfo()
143146 cdef size_t DPCTLPlatform_GetNumNonHostBackends()
You can’t perform that action at this time.
0 commit comments