Platform class helper functions
Overview
Helper functions for sycl::platform
objects that do not directly map to any sycl::platform
member function. More…
// typedefs typedef struct DPCTLPlatformVector* DPCTLPlatformVectorRef; // global functions DPCTL_API const __dpctl_give char* DPCTLPlatformMgr_GetInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity ); DPCTL_API void DPCTLPlatformMgr_PrintInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity ); DPCTL_API void DPCTLPlatformVector_Clear(__dpctl_keep DPCTLPlatformVectorRef VRef); __dpctl_give DPCTLPlatformVectorRef DPCTLPlatformVector_Create(void); DPCTL_API __dpctl_give DPCTLPlatformVectorRef DPCTLPlatformVector_CreateFromArray( size_t len, __dpctl_keep DPCTLSyclPlatformRef* elems ); DPCTL_API void DPCTLPlatformVector_Delete(__dpctl_take DPCTLPlatformVectorRef VRef); DPCTL_API __dpctl_give DPCTLSyclPlatformRef DPCTLPlatformVector_GetAt( __dpctl_keep DPCTLPlatformVectorRef VRef, size_t index ); DPCTL_API size_t DPCTLPlatformVector_Size(__dpctl_keep DPCTLPlatformVectorRef VRef);
Detailed Documentation
Helper functions for sycl::platform
objects that do not directly map to any sycl::platform
member function.
Global Functions
DPCTL_API const __dpctl_give char* DPCTLPlatformMgr_GetInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity )
Returns a set of platform info attributes as a string.
The helper function is used to get metadata about a given platform. The amount of information received is controlled by the verbosity level.
Verbosity level 0: Returns only the name of the platform. Verbosity level 1: Returns the name, version, vendor, backend, number of devices in the platform. Verbosity level 2: Returns everything in level 1 and also returns the name, version, and filter string for each device in the platform.
Parameters:
PRef |
A DPCTLSyclPlatformRef opaque pointer. |
verbosity |
Verbosilty level to control how much information is printed out. |
Returns:
A formatted C string capturing the information about the sycl::platform argument.
DPCTL_API void DPCTLPlatformMgr_PrintInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity )
Prints out information about the sycl::platform argument.
The helper function is used to print metadata about a given platform. The amount of information printed out is controlled by the verbosity level.
Verbosity level 0: Prints only the name of the platform. Verbosity level 1: Prints the name, version, vendor, backend, number of devices in the platform. Verbosity level 2: Prints everything in level 1 and also prints the name, version, and filter string for each device in the platform.
Parameters:
PRef |
A DPCTLSyclPlatformRef opaque pointer. |
verbosity |
Verbosilty level to control how much information is printed out. |
DPCTL_API void DPCTLPlatformVector_Clear(__dpctl_keep DPCTLPlatformVectorRef VRef)
Delete all the elements of the std::vector.
Parameters:
VRef |
Opaque pointer to a vector. |
__dpctl_give DPCTLPlatformVectorRef DPCTLPlatformVector_Create(void)
Create an opaque pointer to a std::vector of opaque pointers wrapping the SYCL data type.
Returns:
Returns a new opaque pointer to a vector.
DPCTL_API __dpctl_give DPCTLPlatformVectorRef DPCTLPlatformVector_CreateFromArray( size_t len, __dpctl_keep DPCTLSyclPlatformRef* elems )
Create an opaque pointer to a std::vector created from the input raw array. The elements of the input array are deep copied before inserting the copies into the vector.
Parameters:
len |
Number of elements in the input array. |
elems |
A C array whose elements will be copied into the returned vector. |
Returns:
Returns a new opaque pointer to a vector.
DPCTL_API void DPCTLPlatformVector_Delete(__dpctl_take DPCTLPlatformVectorRef VRef)
Delete all elements in the vector and then delete the vector.
Parameters:
VRef |
Opaque pointer to a vector to be deleted. |
DPCTL_API __dpctl_give DPCTLSyclPlatformRef DPCTLPlatformVector_GetAt( __dpctl_keep DPCTLPlatformVectorRef VRef, size_t index )
Returns the element at the specified index.
Parameters:
VRef |
Opaque pointer to a vector. |
index |
The index position of the element to be returned. |
Returns:
The element at the specified position, if the index position is out of bounds then a nullptr is returned.
DPCTL_API size_t DPCTLPlatformVector_Size(__dpctl_keep DPCTLPlatformVectorRef VRef)
Returns the number of elements in the vector.
Parameters:
VRef |
Opaque pointer to a vector. |
Returns:
The current size of the vector.