_PI_ERRC(PI_SUCCESS, 0)
_PI_ERRC(PI_ERROR_DEVICE_NOT_FOUND, -1)
_PI_ERRC(PI_ERROR_DEVICE_NOT_AVAILABLE, -2)
_PI_ERRC(PI_ERROR_COMPILER_NOT_AVAILABLE, -3)
_PI_ERRC(PI_ERROR_MEM_OBJECT_ALLOCATION_FAILURE, -4)
_PI_ERRC(PI_ERROR_OUT_OF_RESOURCES, -5)
_PI_ERRC(PI_ERROR_OUT_OF_HOST_MEMORY, -6)
_PI_ERRC(PI_ERROR_PROFILING_INFO_NOT_AVAILABLE, -7)
_PI_ERRC(PI_ERROR_MEM_COPY_OVERLAP, -8)
_PI_ERRC(PI_ERROR_IMAGE_FORMAT_MISMATCH, -9)
_PI_ERRC(PI_ERROR_IMAGE_FORMAT_NOT_SUPPORTED, -10)
_PI_ERRC(PI_ERROR_BUILD_PROGRAM_FAILURE, -11)
_PI_ERRC(PI_ERROR_MAP_FAILURE, -12)
_PI_ERRC(PI_ERROR_MISALIGNED_SUB_BUFFER_OFFSET, -13)
_PI_ERRC(PI_ERROR_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, -14)
_PI_ERRC(PI_ERROR_COMPILE_PROGRAM_FAILURE, -15)
_PI_ERRC(PI_ERROR_LINKER_NOT_AVAILABLE, -16)
_PI_ERRC(PI_ERROR_LINK_PROGRAM_FAILURE, -17)
_PI_ERRC(PI_ERROR_DEVICE_PARTITION_FAILED, -18)
_PI_ERRC(PI_ERROR_KERNEL_ARG_INFO_NOT_AVAILABLE, -19)
_PI_ERRC(PI_ERROR_INVALID_VALUE, -30)
_PI_ERRC(PI_ERROR_INVALID_DEVICE_TYPE, -31)
_PI_ERRC(PI_ERROR_INVALID_PLATFORM, -32)
_PI_ERRC(PI_ERROR_INVALID_DEVICE, -33)
_PI_ERRC(PI_ERROR_INVALID_CONTEXT, -34)
_PI_ERRC(PI_ERROR_INVALID_QUEUE_PROPERTIES, -35)
_PI_ERRC(PI_ERROR_INVALID_QUEUE, -36)
_PI_ERRC(PI_ERROR_INVALID_HOST_PTR, -37)
_PI_ERRC(PI_ERROR_INVALID_MEM_OBJECT, -38)
_PI_ERRC(PI_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR, -39)
_PI_ERRC(PI_ERROR_INVALID_IMAGE_SIZE, -40)
_PI_ERRC(PI_ERROR_INVALID_SAMPLER, -41)
_PI_ERRC(PI_ERROR_INVALID_BINARY, -42)
_PI_ERRC(PI_ERROR_INVALID_BUILD_OPTIONS, -43)
_PI_ERRC(PI_ERROR_INVALID_PROGRAM, -44)
_PI_ERRC(PI_ERROR_INVALID_PROGRAM_EXECUTABLE, -45)
_PI_ERRC(PI_ERROR_INVALID_KERNEL_NAME, -46)
_PI_ERRC(PI_ERROR_INVALID_KERNEL_DEFINITION, -47)
_PI_ERRC(PI_ERROR_INVALID_KERNEL, -48)
_PI_ERRC(PI_ERROR_INVALID_ARG_INDEX, -49)
_PI_ERRC(PI_ERROR_INVALID_ARG_VALUE, -50)
_PI_ERRC(PI_ERROR_INVALID_ARG_SIZE, -51)
_PI_ERRC(PI_ERROR_INVALID_KERNEL_ARGS, -52)
_PI_ERRC(PI_ERROR_INVALID_WORK_DIMENSION, -53)
_PI_ERRC(PI_ERROR_INVALID_WORK_GROUP_SIZE, -54)
_PI_ERRC(PI_ERROR_INVALID_WORK_ITEM_SIZE, -55)
_PI_ERRC(PI_ERROR_INVALID_GLOBAL_OFFSET, -56)
_PI_ERRC(PI_ERROR_INVALID_EVENT_WAIT_LIST, -57)
_PI_ERRC(PI_ERROR_INVALID_EVENT, -58)
_PI_ERRC(PI_ERROR_INVALID_OPERATION, -59)
_PI_ERRC(PI_ERROR_INVALID_GL_OBJECT, -60)
_PI_ERRC(PI_ERROR_INVALID_BUFFER_SIZE, -61)
_PI_ERRC(PI_ERROR_INVALID_MIP_LEVEL, -62)
_PI_ERRC(PI_ERROR_INVALID_GLOBAL_WORK_SIZE, -63)
_PI_ERRC(PI_ERROR_INVALID_PROPERTY, -64)
_PI_ERRC(PI_ERROR_INVALID_IMAGE_DESCRIPTOR, -65)
_PI_ERRC(PI_ERROR_INVALID_COMPILER_OPTIONS, -66)
_PI_ERRC(PI_ERROR_INVALID_LINKER_OPTIONS, -67)
_PI_ERRC(PI_ERROR_INVALID_DEVICE_PARTITION_COUNT, -68)
// cl_gl
_PI_ERRC(PI_ERROR_INVALID_GL_SHAREGROUP_REFERENCE_KHR, -1000)
// KHR Extension
_PI_ERRC(PI_ERROR_PLATFORM_NOT_FOUND_KHR, -1001)
// cl_d3d10
_PI_ERRC(PI_ERROR_INVALID_D3D10_DEVICE_KHR, -1002)
_PI_ERRC(PI_ERROR_INVALID_D3D10_RESOURCE_KHR, -1003)
_PI_ERRC(PI_ERROR_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR, -1004)
_PI_ERRC(PI_ERROR_D3D10_RESOURCE_NOT_ACQUIRED_KHR, -1005)
// cl_d3d11
_PI_ERRC(PI_ERROR_INVALID_D3D11_DEVICE_KHR, -1006)
_PI_ERRC(PI_ERROR_INVALID_D3D11_RESOURCE_KHR, -1007)
_PI_ERRC(PI_ERROR_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR, -1008)
_PI_ERRC(PI_ERROR_D3D11_RESOURCE_NOT_ACQUIRED_KHR, -1009)
// cl_dx9_media_sharing
_PI_ERRC(PI_ERROR_INVALID_DX9_DEVICE_INTEL, -1010)
_PI_ERRC(PI_ERROR_INVALID_DX9_RESOURCE_INTEL, -1011)
_PI_ERRC(PI_ERROR_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL, -1012)
_PI_ERRC(PI_ERROR_DX9_RESOURCE_NOT_ACQUIRED_INTEL, -1013)
// cl_ext
_PI_ERRC(PI_ERROR_INVALID_COMMAND_BUFFER_KHR, -1138)
_PI_ERRC(PI_ERROR_INVALID_SYNC_POINT_WAIT_LIST_KHR, -1139)
_PI_ERRC(PI_ERROR_INCOMPATIBLE_COMMAND_QUEUE_KHR, -1140)
// Generic extensions
_PI_ERRC(PI_ERROR_DEVICE_PARTITION_FAILED_EXT, -1057)
_PI_ERRC(PI_ERROR_INVALID_PARTITION_COUNT_EXT, -1058)
_PI_ERRC(PI_ERROR_INVALID_PARTITION_NAME_EXT, -1059)
// cl_egl
_PI_ERRC(PI_ERROR_EGL_RESOURCE_NOT_ACQUIRED_KHR, -1092)
_PI_ERRC(PI_ERROR_INVALID_EGL_OBJECT_KHR, -1093)
// cl_intel_accelerator
_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_INTEL, -1094)
_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_TYPE_INTEL, -1095)
_PI_ERRC(PI_ERROR_INVALID_ACCELERATOR_DESCRIPTOR_INTEL, -1096)
_PI_ERRC(PI_ERROR_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL, -1097)
// cl_va_api_media_sharing_intel
_PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_ADAPTER_INTEL, -1098)
_PI_ERRC(PI_ERROR_INVALID_VA_API_MEDIA_SURFACE_INTEL, -1099)
_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL, -1100)
_PI_ERRC(PI_ERROR_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL, -1101)
// backend is lost, e.g. it was already unloaded
_PI_ERRC(PI_ERROR_UNINITIALIZED, -1102)

// PI specific error codes
// PI_ERROR_PLUGIN_SPECIFIC_ERROR indicates that an backend spcific error or
// warning has been emitted by the plugin.
_PI_ERRC_WITH_MSG(PI_ERROR_PLUGIN_SPECIFIC_ERROR, -996, "The plugin has emitted a backend specific error")
// PI_ERROR_COMMAND_EXECUTION_FAILURE indicates an error occurred during command
// enqueue or execution.
_PI_ERRC_WITH_MSG(PI_ERROR_COMMAND_EXECUTION_FAILURE, -997, "Command failed to enqueue/execute")
// PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE indicates a fallback method
// determines the function exists but its address cannot be found.
_PI_ERRC_WITH_MSG(PI_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE, -998, "Function exists but address is not available")
_PI_ERRC_WITH_MSG(PI_ERROR_UNKNOWN, -999, "Unknown PI error")
