Global Namespace¶
Overview¶
// namespaces namespace dpctl; namespace dpctl::syclinterface; // typedefs typedef void error_handler_callback(int err_code); typedef struct DPCTLDeviceVector* DPCTLDeviceVectorRef; typedef struct DPCTLEventVector* DPCTLEventVectorRef; typedef struct DPCTLPlatformVector* DPCTLPlatformVectorRef; typedef struct MDLocalAccessorTy MDLocalAccessor; typedef struct DPCTLOpaqueSyclContext* DPCTLSyclContextRef; typedef struct DPCTLOpaqueSyclDevice* DPCTLSyclDeviceRef; typedef struct DPCTLOpaqueSyclDeviceSelector* DPCTLSyclDeviceSelectorRef; typedef struct DPCTLOpaqueSyclEvent* DPCTLSyclEventRef; typedef struct DPCTLOpaqueSyclKernelBundle* DPCTLSyclKernelBundleRef; typedef struct DPCTLOpaqueSyclKernel* DPCTLSyclKernelRef; typedef struct DPCTLOpaqueSyclPlatform* DPCTLSyclPlatformRef; typedef struct DPCTLOpaqueSyclQueue* DPCTLSyclQueueRef; typedef struct DPCTLOpaqueSyclUSM* DPCTLSyclUSMRef; // enums enum DPCTLGlobalMemCacheType; enum DPCTLKernelArgType; enum DPCTLPartitionAffinityDomainType; enum DPCTLQueuePropertyType; enum DPCTLSyclAspectType; enum DPCTLSyclBackendType; enum DPCTLSyclDeviceType; enum DPCTLSyclEventStatusType; enum DPCTLSyclUSMType; // structs struct MDLocalAccessorTy; // global functions DPCTL_API __dpctl_give const char* DPCTLService_GetDPCPPVersion(void); DPCTL_API void DPCTLService_InitLogger( const char* app_name, const char* log_dir ); DPCTL_API void DPCTLService_ShutdownLogger(void); DPCTL_API bool DPCTLContext_AreEq( __dpctl_keep const DPCTLSyclContextRef CtxRef1, __dpctl_keep const DPCTLSyclContextRef CtxRef2 ); DPCTL_API __dpctl_give DPCTLSyclContextRef DPCTLContext_Copy(__dpctl_keep const DPCTLSyclContextRef CRef); DPCTL_API __dpctl_give DPCTLSyclContextRef DPCTLContext_Create( __dpctl_keep const DPCTLSyclDeviceRef DRef, error_handler_callback* handler, int properties ); DPCTL_API __dpctl_give DPCTLSyclContextRef DPCTLContext_CreateFromDevices( __dpctl_keep const DPCTLDeviceVectorRef DVRef, error_handler_callback* handler, int properties ); DPCTL_API void DPCTLContext_Delete(__dpctl_take DPCTLSyclContextRef CtxRef); DPCTL_API size_t DPCTLContext_DeviceCount(__dpctl_keep const DPCTLSyclContextRef CRef); DPCTL_API DPCTLSyclBackendType DPCTLContext_GetBackend(__dpctl_keep const DPCTLSyclContextRef CtxRef); DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLContext_GetDevices(__dpctl_keep const DPCTLSyclContextRef CRef); DPCTL_API size_t DPCTLContext_Hash(__dpctl_keep DPCTLSyclContextRef CtxRef); DPCTL_API bool DPCTLDevice_AreEq( __dpctl_keep const DPCTLSyclDeviceRef DRef1, __dpctl_keep const DPCTLSyclDeviceRef DRef2 ); DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Copy(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create(void); DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_CreateFromSelector(__dpctl_keep const DPCTLSyclDeviceSelectorRef DSRef); DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesByAffinity( __dpctl_keep const DPCTLSyclDeviceRef DRef, DPCTLPartitionAffinityDomainType PartAffDomTy ); DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesByCounts( __dpctl_keep const DPCTLSyclDeviceRef DRef, __dpctl_keep size_t* counts, size_t ncounts ); DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLDevice_CreateSubDevicesEqually( __dpctl_keep const DPCTLSyclDeviceRef DRef, size_t count ); DPCTL_API void DPCTLDevice_Delete(__dpctl_take DPCTLSyclDeviceRef DRef); DPCTL_API DPCTLSyclBackendType DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API DPCTLSyclDeviceType DPCTLDevice_GetDeviceType(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give const char* DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetGlobalMemCacheLineSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint64_t DPCTLDevice_GetGlobalMemCacheSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API DPCTLGlobalMemCacheType DPCTLDevice_GetGlobalMemCacheType(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint64_t DPCTLDevice_GetGlobalMemSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetImage2dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetImage2dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetImage3dMaxDepth(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetImage3dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetImage3dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint64_t DPCTLDevice_GetLocalMemSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxClockFrequency(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxComputeUnits(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint64_t DPCTLDevice_GetMaxMemAllocSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxReadImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetMaxWorkGroupSize(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxWorkItemDims(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_keep size_t* DPCTLDevice_GetMaxWorkItemSizes1d(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_keep size_t* DPCTLDevice_GetMaxWorkItemSizes2d(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_keep size_t* DPCTLDevice_GetMaxWorkItemSizes3d(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetMaxWriteImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give const char* DPCTLDevice_GetName(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthChar(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthDouble(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthFloat(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthHalf(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthInt(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthLong(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetNativeVectorWidthShort(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_GetParentDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPartitionMaxSubDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give DPCTLSyclPlatformRef DPCTLDevice_GetPlatform(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthChar(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthDouble(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthFloat(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthHalf(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthInt(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthLong(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API uint32_t DPCTLDevice_GetPreferredVectorWidthShort(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API size_t DPCTLDevice_GetProfilingTimerResolution(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_GetSubGroupIndependentForwardProgress(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_keep size_t* DPCTLDevice_GetSubGroupSizes( __dpctl_keep const DPCTLSyclDeviceRef DRef, size_t* res_len ); DPCTL_API __dpctl_give const char* DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_HasAspect( __dpctl_keep const DPCTLSyclDeviceRef DRef, DPCTLSyclAspectType AT ); DPCTL_API size_t DPCTLDevice_Hash(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_IsAccelerator(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_IsCPU(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API bool DPCTLDevice_IsGPU(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API DPCTLSyclContextRef DPCTLDeviceMgr_GetCachedContext(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give const char* DPCTLDeviceMgr_GetDeviceInfoStr(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API __dpctl_give DPCTLDeviceVectorRef DPCTLDeviceMgr_GetDevices(int device_identifier); DPCTL_API size_t DPCTLDeviceMgr_GetNumDevices(int device_identifier); DPCTL_API int DPCTLDeviceMgr_GetPositionInDevices( __dpctl_keep DPCTLSyclDeviceRef DRef, int device_identifier ); DPCTL_API int64_t DPCTLDeviceMgr_GetRelativeId(__dpctl_keep const DPCTLSyclDeviceRef DRef); DPCTL_API void DPCTLDeviceMgr_PrintDeviceInfo(__dpctl_keep const DPCTLSyclDeviceRef DRef); void DPCTLDeviceVector_Clear(DPCTLDeviceVectorRef VRef); DPCTLDeviceVectorRef DPCTLDeviceVector_Create(void); DPCTLDeviceVectorRef DPCTLDeviceVector_CreateFromArray( size_t len, DPCTLSyclDeviceRef* elems ); void DPCTLDeviceVector_Delete(DPCTLDeviceVectorRef VRef); DPCTLSyclDeviceRef DPCTLDeviceVector_GetAt( DPCTLDeviceVectorRef VRef, size_t index ); size_t DPCTLDeviceVector_Size(DPCTLDeviceVectorRef VRef); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLAcceleratorSelector_Create(void); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create(void); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLDefaultSelector_Create(void); DPCTL_API void DPCTLDeviceSelector_Delete(__dpctl_take DPCTLSyclDeviceSelectorRef DSRef); DPCTL_API int DPCTLDeviceSelector_Score( __dpctl_keep DPCTLSyclDeviceSelectorRef DSRef, __dpctl_keep DPCTLSyclDeviceRef DRef ); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLFilterSelector_Create(__dpctl_keep const char* filter_str); DPCTL_API __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create(void); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLEvent_Copy(__dpctl_keep const DPCTLSyclEventRef ERef); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLEvent_Create(void); DPCTL_API void DPCTLEvent_Delete(__dpctl_take DPCTLSyclEventRef ERef); DPCTL_API DPCTLSyclBackendType DPCTLEvent_GetBackend(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API DPCTLSyclEventStatusType DPCTLEvent_GetCommandExecutionStatus(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API uint64_t DPCTLEvent_GetProfilingInfoEnd(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API uint64_t DPCTLEvent_GetProfilingInfoStart(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API uint64_t DPCTLEvent_GetProfilingInfoSubmit(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API __dpctl_give DPCTLEventVectorRef DPCTLEvent_GetWaitList(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API void DPCTLEvent_Wait(__dpctl_keep DPCTLSyclEventRef ERef); DPCTL_API void DPCTLEvent_WaitAndThrow(__dpctl_keep DPCTLSyclEventRef ERef); void DPCTLEventVector_Clear(DPCTLEventVectorRef VRef); DPCTLEventVectorRef DPCTLEventVector_Create(void); DPCTLEventVectorRef DPCTLEventVector_CreateFromArray( size_t len, DPCTLSyclEventRef* elems ); void DPCTLEventVector_Delete(DPCTLEventVectorRef VRef); DPCTLSyclEventRef DPCTLEventVector_GetAt( DPCTLEventVectorRef VRef, size_t index ); size_t DPCTLEventVector_Size(DPCTLEventVectorRef VRef); DPCTL_API __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_Copy(__dpctl_keep const DPCTLSyclKernelBundleRef KBRef); DPCTL_API __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromOCLSource( __dpctl_keep const DPCTLSyclContextRef Ctx, __dpctl_keep const DPCTLSyclDeviceRef Dev, __dpctl_keep const char* Source, __dpctl_keep const char* CompileOpts ); DPCTL_API __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSpirv( __dpctl_keep const DPCTLSyclContextRef Ctx, __dpctl_keep const DPCTLSyclDeviceRef Dev, __dpctl_keep const void* IL, size_t Length, const char* CompileOpts ); DPCTL_API void DPCTLKernelBundle_Delete(__dpctl_take DPCTLSyclKernelBundleRef KBRef); DPCTL_API __dpctl_give DPCTLSyclKernelRef DPCTLKernelBundle_GetKernel( __dpctl_keep DPCTLSyclKernelBundleRef KBRef, __dpctl_keep const char* KernelName ); DPCTL_API bool DPCTLKernelBundle_HasKernel( __dpctl_keep DPCTLSyclKernelBundleRef KBRef, __dpctl_keep const char* KernelName ); DPCTL_API __dpctl_give DPCTLSyclKernelRef DPCTLKernel_Copy(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API void DPCTLKernel_Delete(__dpctl_take DPCTLSyclKernelRef KRef); DPCTL_API uint32_t DPCTLKernel_GetCompileNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API uint32_t DPCTLKernel_GetCompileSubGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API uint32_t DPCTLKernel_GetMaxNumSubGroups(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API uint32_t DPCTLKernel_GetMaxSubGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API size_t DPCTLKernel_GetNumArgs(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API size_t DPCTLKernel_GetPreferredWorkGroupSizeMultiple(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API size_t DPCTLKernel_GetPrivateMemSize(__dpctl_keep const DPCTLSyclKernelRef KRef); DPCTL_API size_t DPCTLKernel_GetWorkGroupSize(__dpctl_keep const DPCTLSyclKernelRef KRef); 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); DPCTL_API __dpctl_give const char* DPCTLPlatformMgr_GetInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity ); DPCTL_API void DPCTLPlatformMgr_PrintInfo( __dpctl_keep const DPCTLSyclPlatformRef PRef, size_t verbosity ); void DPCTLPlatformVector_Clear(DPCTLPlatformVectorRef VRef); DPCTLPlatformVectorRef DPCTLPlatformVector_Create(void); DPCTLPlatformVectorRef DPCTLPlatformVector_CreateFromArray( size_t len, DPCTLSyclPlatformRef* elems ); void DPCTLPlatformVector_Delete(DPCTLPlatformVectorRef VRef); DPCTLSyclPlatformRef DPCTLPlatformVector_GetAt( DPCTLPlatformVectorRef VRef, size_t index ); size_t DPCTLPlatformVector_Size(DPCTLPlatformVectorRef VRef); DPCTL_API bool DPCTLQueue_AreEq( __dpctl_keep const DPCTLSyclQueueRef QRef1, __dpctl_keep const DPCTLSyclQueueRef QRef2 ); DPCTL_API __dpctl_give DPCTLSyclQueueRef DPCTLQueue_Copy(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclQueueRef DPCTLQueue_Create( __dpctl_keep const DPCTLSyclContextRef CRef, __dpctl_keep const DPCTLSyclDeviceRef DRef, error_handler_callback* handler, int properties ); DPCTL_API __dpctl_give DPCTLSyclQueueRef DPCTLQueue_CreateForDevice( __dpctl_keep const DPCTLSyclDeviceRef DRef, error_handler_callback* handler, int properties ); DPCTL_API void DPCTLQueue_Delete(__dpctl_take DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Fill128( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint64_t* Value, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Fill16( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint16_t Value, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Fill32( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint32_t Value, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Fill64( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint64_t Value, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Fill8( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint8_t Value, size_t Count ); DPCTL_API DPCTLSyclBackendType DPCTLQueue_GetBackend(__dpctl_keep DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclContextRef DPCTLQueue_GetContext(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLQueue_GetDevice(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API bool DPCTLQueue_HasEnableProfiling(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API size_t DPCTLQueue_Hash(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API bool DPCTLQueue_IsInOrder(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_MemAdvise( __dpctl_keep DPCTLSyclQueueRef QRef, const void* Ptr, size_t Count, int Advice ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Memcpy( __dpctl_keep const DPCTLSyclQueueRef QRef, void* Dest, const void* Src, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_MemcpyWithEvents( __dpctl_keep const DPCTLSyclQueueRef QRef, void* Dest, const void* Src, size_t Count, __dpctl_keep const DPCTLSyclEventRef* DepEvents, size_t DepEventsCount ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Memset( __dpctl_keep const DPCTLSyclQueueRef QRef, void* USMRef, uint8_t Value, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_Prefetch( __dpctl_keep DPCTLSyclQueueRef QRef, const void* Ptr, size_t Count ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitBarrier(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitBarrierForEvents( __dpctl_keep const DPCTLSyclQueueRef QRef, __dpctl_keep const DPCTLSyclEventRef* DepEvents, size_t NDepEvents ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitNDRange( __dpctl_keep const DPCTLSyclKernelRef KRef, __dpctl_keep const DPCTLSyclQueueRef QRef, __dpctl_keep void** Args, __dpctl_keep const DPCTLKernelArgType* ArgTypes, size_t NArgs, __dpctl_keep const size_t gRange[3], __dpctl_keep const size_t lRange[3], size_t NDims, __dpctl_keep const DPCTLSyclEventRef* DepEvents, size_t NDepEvents ); DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitRange( __dpctl_keep const DPCTLSyclKernelRef KRef, __dpctl_keep const DPCTLSyclQueueRef QRef, __dpctl_keep void** Args, __dpctl_keep const DPCTLKernelArgType* ArgTypes, size_t NArgs, __dpctl_keep const size_t Range[3], size_t NRange, __dpctl_keep const DPCTLSyclEventRef* DepEvents, size_t NDepEvents ); DPCTL_API void DPCTLQueue_Wait(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclQueueRef DPCTLQueueMgr_GetCurrentQueue(void); DPCTL_API size_t DPCTLQueueMgr_GetQueueStackSize(void); DPCTL_API bool DPCTLQueueMgr_GlobalQueueIsCurrent(void); DPCTL_API bool DPCTLQueueMgr_IsCurrentQueue(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API void DPCTLQueueMgr_PopQueue(void); DPCTL_API void DPCTLQueueMgr_PushQueue(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API void DPCTLQueueMgr_SetGlobalQueue(__dpctl_keep const DPCTLSyclQueueRef QRef); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLaligned_alloc_device( size_t alignment, size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLaligned_alloc_host( size_t alignment, size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLaligned_alloc_shared( size_t alignment, size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API void DPCTLfree_with_context( __dpctl_take DPCTLSyclUSMRef MRef, __dpctl_keep const DPCTLSyclContextRef CRef ); DPCTL_API void DPCTLfree_with_queue( __dpctl_take DPCTLSyclUSMRef MRef, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLmalloc_device( size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLmalloc_host( size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API __dpctl_give DPCTLSyclUSMRef DPCTLmalloc_shared( size_t size, __dpctl_keep const DPCTLSyclQueueRef QRef ); DPCTL_API DPCTLSyclDeviceRef DPCTLUSM_GetPointerDevice( __dpctl_keep const DPCTLSyclUSMRef MRef, __dpctl_keep const DPCTLSyclContextRef CRef ); DPCTL_API DPCTLSyclUSMType DPCTLUSM_GetPointerType( __dpctl_keep const DPCTLSyclUSMRef MRef, __dpctl_keep const DPCTLSyclContextRef CRef ); DPCTL_C_EXTERN_C_BEGIN DPCTL_API void DPCTLCString_Delete(__dpctl_take const char* str); DPCTL_API void DPCTLSize_t_Array_Delete(__dpctl_take size_t* arr); // macros #define DPCTL_C_EXTERN_C_BEGIN #define DPCTL_C_EXTERN_C_END #define DPCTL_DECLARE_VECTOR(EL) #define DPCTL_DECLARE_VECTOR_FN(EL) #define DPCTL_DECLARE_VECTOR_TYPE(EL) #define DPCTL_DPCPP_VERSION #define DPCTL_ENABLE_L0_PROGRAM_CREATION #define DPCTL_LIBCL_LOADER_FILENAME #define DPCTL_LIBZE_LOADER_FILENAME #define HUGE_VALF #define INT64_MAX #define INT64_MIN #define UINT64_MAX #define __SYCL_COMPILER_VERSION_REQUIRED #define __dpctl_give #define __dpctl_keep #define __dpctl_null #define __dpctl_take
Detailed Documentation¶
Typedefs¶
typedef void error_handler_callback(int err_code)
Type of function to be used in SYCL async error handler provide by DPCTL.
Parameters:
err_code |
Error code extracted from an SYCL asynchronous error. |
typedef struct MDLocalAccessorTy MDLocalAccessor
Structure to be used to specify dimensionality and type of local_accessor kernel type argument.
typedef struct DPCTLOpaqueSyclContext* DPCTLSyclContextRef
Opaque pointer to a sycl::context
typedef struct DPCTLOpaqueSyclDevice* DPCTLSyclDeviceRef
Opaque pointer to a sycl::device
typedef struct DPCTLOpaqueSyclDeviceSelector* DPCTLSyclDeviceSelectorRef
Opaque pointer to a sycl::device_selector
typedef struct DPCTLOpaqueSyclEvent* DPCTLSyclEventRef
Opaque pointer to a sycl::event
typedef struct DPCTLOpaqueSyclKernelBundle* DPCTLSyclKernelBundleRef
Opaque pointer to a sycl::kernel_bundle<sycl::bundle_state::executable>
typedef struct DPCTLOpaqueSyclKernel* DPCTLSyclKernelRef
Opaque pointer to a sycl::kernel
typedef struct DPCTLOpaqueSyclPlatform* DPCTLSyclPlatformRef
Opaque pointer to a sycl::platform
typedef struct DPCTLOpaqueSyclQueue* DPCTLSyclQueueRef
Opaque pointer to a sycl::queue
typedef struct DPCTLOpaqueSyclUSM* DPCTLSyclUSMRef
Used to pass a sycl::usm
memory opaquely through DPCTL interfaces.
Global Functions¶
DPCTL_API uint32_t DPCTLDevice_GetGlobalMemCacheLineSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::global_mem_cache_line_size>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the size of global memory cache line in bytes as uint32_t.
DPCTL_API uint64_t DPCTLDevice_GetGlobalMemCacheSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::global_mem_cache_size>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the size of global memory cache in bytes as uint64_t.
DPCTL_API DPCTLGlobalMemCacheType DPCTLDevice_GetGlobalMemCacheType(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::global_mem_cache_type>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the type of global memory cache supported.
DPCTL_API size_t DPCTLDevice_GetImage2dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::image2d_max_height>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum height of a 2D image or 1D image in pixels. The minimum value is 8192 if the SYCL device has aspect::image.
DPCTL_API size_t DPCTLDevice_GetImage2dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::image2d_max_width>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum width of a 2D image or 1D image in pixels. The minimum value is 8192 if the SYCL device has aspect::image.
DPCTL_API size_t DPCTLDevice_GetImage3dMaxDepth(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::image3d_max_depth>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum depth of a 3D image The minimum value is 2048 if the SYCL device has aspect::image.
DPCTL_API size_t DPCTLDevice_GetImage3dMaxHeight(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::image3d_max_height>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum height of a 3D image The minimum value is 2048 if the SYCL device has aspect::image.
DPCTL_API size_t DPCTLDevice_GetImage3dMaxWidth(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::image3d_max_width>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum width of a 3D image in pixels. The minimum value is 2048 if the SYCL device has aspect::image.
DPCTL_API uint32_t DPCTLDevice_GetMaxClockFrequency(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::max_clock_frequency>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum clock frequency in MHz as uint32_t.
DPCTL_API uint64_t DPCTLDevice_GetMaxMemAllocSize(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::max_mem_alloc_size>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum size of memory object in bytes as uint64_t.
DPCTL_API uint32_t DPCTLDevice_GetMaxReadImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::max_read_image_args>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum number of simultaneous image objects that can be read from by a kernel. The minimum value is 128 if the SYCL device has aspect::image.
DPCTL_API uint32_t DPCTLDevice_GetMaxWriteImageArgs(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::max_write_image_args>().
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum number of simultaneous image objects that can be written to by a kernel. The minimum value is 8 if the SYCL device has aspect::image.
DPCTL_API __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_GetParentDevice(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::parent_device>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns an opaque pointer to the parent device for a sub-device, or nullptr otherwise.
DPCTL_API uint32_t DPCTLDevice_GetPartitionMaxSubDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::partition_max_sub_devices>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the maximum number of sub-devices that can be created when this device is partitioned.
DPCTL_API size_t DPCTLDevice_GetProfilingTimerResolution(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over device.get_info<info::device::profiling_timer_resolution>
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns the resolution of device timer in nanoseconds.
DPCTL_API size_t DPCTLDevice_Hash(__dpctl_keep const DPCTLSyclDeviceRef DRef)
Wrapper over std::hash<sycl::device>’s operator()
Parameters:
DRef |
Opaque pointer to a sycl::device |
Returns:
Returns hash value.
void DPCTLEventVector_Clear(DPCTLEventVectorRef VRef)
Delete all the elements of the std::vector.
Parameters:
VRef |
Opaque pointer to a vector. |
DPCTLEventVectorRef DPCTLEventVector_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.
DPCTLEventVectorRef DPCTLEventVector_CreateFromArray( size_t len, DPCTLSyclEventRef* 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.
void DPCTLEventVector_Delete(DPCTLEventVectorRef VRef)
Delete all elements in the vector and then delete the vector.
Parameters:
VRef |
Opaque pointer to a vector to be deleted. |
DPCTLSyclEventRef DPCTLEventVector_GetAt( DPCTLEventVectorRef 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.
size_t DPCTLEventVector_Size(DPCTLEventVectorRef VRef)
Returns the number of elements in the vector.
Parameters:
VRef |
Opaque pointer to a vector. |
Returns:
The current size of the vector.
DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitBarrier(__dpctl_keep const DPCTLSyclQueueRef QRef)
C-API wrapper for sycl::queue::submit_barrier()
.
Parameters:
QRef |
An opaque pointer to the |
Returns:
An opaque pointer to the sycl::event
returned by the sycl::queue::submit_barrier()
function.
DPCTL_API __dpctl_give DPCTLSyclEventRef DPCTLQueue_SubmitBarrierForEvents( __dpctl_keep const DPCTLSyclQueueRef QRef, __dpctl_keep const DPCTLSyclEventRef* DepEvents, size_t NDepEvents )
C-API wrapper for sycl::queue::submit_barrier(event_vector)
.
Parameters:
QRef |
An opaque pointer to the |
DepEvents |
List of dependent DPCTLSyclEventRef objects (events) for the barrier. We call |
NDepEvents |
Size of the DepEvents list. |
Returns:
An opaque pointer to the sycl::event
returned by the sycl::queue::submit_barrier()
function.
DPCTL_C_EXTERN_C_BEGIN DPCTL_API void DPCTLCString_Delete(__dpctl_take const char* str)
Deletes the C String argument.
Parameters:
str |
C string to be deleted |
DPCTL_API void DPCTLSize_t_Array_Delete(__dpctl_take size_t* arr)
Deletes an array of size_t elements.
Parameters:
arr |
Array to be deleted. |
Macros¶
#define DPCTL_DECLARE_VECTOR_TYPE(EL)
Declare an opaque pointer type for a std::vector of opaque pointers wrapping SYCL data types.
#define HUGE_VALF
Represents a positive expression of type float.
#define INT64_MAX
Represents the largest possible value of a 64 bit signed integer.
#define INT64_MIN
Represents the smallest possible value of a 64 bit signed integer.
#define UINT64_MAX
Represents the largest possible value of a 64bit unsigned integer.