Platform class C wrapper

Overview

// global functions

DPCTL_API bool
DPCTLPlatform_AreEq(
    __dpctl_keep const DPCTLSyclPlatformRef PRef1,
    __dpctl_keep const DPCTLSyclPlatformRef PRef2
    );

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_Copy(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_Create(void);

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_CreateFromSelector(__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef);

DPCTL_API void
DPCTLPlatform_Delete(__dpctl_take DPCTLSyclPlatformRef PRef);

DPCTL_API DPCTLSyclBackendType
DPCTLPlatform_GetBackend(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API __dpctl_give DPCTLSyclContextRef
DPCTLPlatform_GetDefaultContext(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetName(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API __dpctl_give DPCTLPlatformVectorRef
DPCTLPlatform_GetPlatforms(void);

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetVendor(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetVersion(__dpctl_keep const DPCTLSyclPlatformRef PRef);

DPCTL_API size_t
DPCTLPlatform_Hash(__dpctl_keep DPCTLSyclPlatformRef PRef);

Detailed Documentation

Global Functions

DPCTL_API bool
DPCTLPlatform_AreEq(
    __dpctl_keep const DPCTLSyclPlatformRef PRef1,
    __dpctl_keep const DPCTLSyclPlatformRef PRef2
    )

Checks if two DPCTLSyclPlatformRef objects point to the same sycl::platform.

Parameters:

PRef1

First opaque pointer to a sycl::platform.

PRef2

Second opaque pointer to a sycl::platform.

Returns:

True if the underlying sycl::platform are same, false otherwise.

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_Copy(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns a copy of the DPCTLSyclPlatformRef object.

Parameters:

PRef

DPCTLSyclPlatformRef object to be copied.

Returns:

A new DPCTLSyclPlatformRef created by copying the passed in DPCTLSyclPlatformRef object.

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_Create(void)

Creates a new DPCTLSyclPlatformRef for a SYCL platform constructed using SYCL’s default_selector.

Returns:

A new DPCTLSyclPlatformRef pointer wrapping a SYCL platform object.

DPCTL_API __dpctl_give DPCTLSyclPlatformRef
DPCTLPlatform_CreateFromSelector(__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef)

Creates a new DPCTLSyclPlatformRef for a SYCL platform constructed using the dpctl_device_selector wrapped by DPCTLSyclDeviceSelectorRef.

Parameters:

DSRef

An opaque pointer to a SYCL dpctl_device_selector object.

Returns:

A new DPCTLSyclPlatformRef pointer wrapping a SYCL platform object.

DPCTL_API void
DPCTLPlatform_Delete(__dpctl_take DPCTLSyclPlatformRef PRef)

Deletes the DPCTLSyclProgramRef pointer.

Parameters:

PRef

An opaque pointer to a sycl::platform.

DPCTL_API DPCTLSyclBackendType
DPCTLPlatform_GetBackend(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns a DPCTLSyclBackendType enum value identifying the SYCL backend associated with the platform.

Parameters:

PRef

Opaque pointer to a sycl::platform

Returns:

A DPCTLSyclBackendType enum value identifying the SYCL backend associated with the platform.

DPCTL_API __dpctl_give DPCTLSyclContextRef
DPCTLPlatform_GetDefaultContext(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns a DPCTLSyclContextRef for default platform context.

Parameters:

PRef

Opaque pointer to a sycl::platform

Returns:

A DPCTLSyclContextRef value for the default platform associated with this platform.

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetName(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns a C string for the platform name.

Parameters:

PRef

Opaque pointer to a sycl::platform

Returns:

A C string containing the name of the sycl::platform.

DPCTL_API __dpctl_give DPCTLPlatformVectorRef
DPCTLPlatform_GetPlatforms(void)

Returns an opaque pointer to a vector of SYCL platforms available on the system.

Returns:

A DPCTLPlatformVectorRef containing DPCTLSyclPlatformRef objects.

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetVendor(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns a C string corresponding to the vendor providing the platform.

Parameters:

PRef

Opaque pointer to a sycl::platform

Returns:

A C string containing the name of the vendor providing the platform.

DPCTL_API __dpctl_give const char*
DPCTLPlatform_GetVersion(__dpctl_keep const DPCTLSyclPlatformRef PRef)

Returns the software driver version of the sycl::platform as a C string.

Parameters:

PRef

Opaque pointer to a sycl::platform

Returns:

A C string containing the software driver version of the device associated with the platform.

DPCTL_API size_t
DPCTLPlatform_Hash(__dpctl_keep DPCTLSyclPlatformRef PRef)

Wrapper over std::hash<sycl::platform>’s operator()

Parameters:

PRef

The DPCTLSyclPlatformRef pointer.

Returns:

Hash value of the underlying sycl::platform instance.