[HIP] Unify hipError_t (Step 2)

Step 2. Make a few hipError codes deprecated
Update hipify-clang, hipify-perl, docs and samples accordingly
这个提交包含在:
Evgeny Mankov
2019-12-22 02:05:31 +03:00
父节点 9c91632194
当前提交 dbad4d9b7f
修改 6 个文件,包含 45 行新增95 行删除
+4 -4
查看文件
@@ -1599,7 +1599,7 @@ sub simpleSubstitutions {
$ft{'numeric_literal'} += s/\bcudaErrorHostMemoryAlreadyRegistered\b/hipErrorHostMemoryAlreadyRegistered/g;
$ft{'numeric_literal'} += s/\bcudaErrorHostMemoryNotRegistered\b/hipErrorHostMemoryNotRegistered/g;
$ft{'numeric_literal'} += s/\bcudaErrorIllegalAddress\b/hipErrorIllegalAddress/g;
$ft{'numeric_literal'} += s/\bcudaErrorInitializationError\b/hipErrorInitializationError/g;
$ft{'numeric_literal'} += s/\bcudaErrorInitializationError\b/hipErrorNotInitialized/g;
$ft{'numeric_literal'} += s/\bcudaErrorInsufficientDriver\b/hipErrorInsufficientDriver/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidConfiguration\b/hipErrorInvalidConfiguration/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidDevice\b/hipErrorInvalidDevice/g;
@@ -1609,15 +1609,15 @@ sub simpleSubstitutions {
$ft{'numeric_literal'} += s/\bcudaErrorInvalidKernelImage\b/hipErrorInvalidImage/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidMemcpyDirection\b/hipErrorInvalidMemcpyDirection/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidPtx\b/hipErrorInvalidKernelFile/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidResourceHandle\b/hipErrorInvalidResourceHandle/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidResourceHandle\b/hipErrorInvalidHandle/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidSource\b/hipErrorInvalidSource/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidSymbol\b/hipErrorInvalidSymbol/g;
$ft{'numeric_literal'} += s/\bcudaErrorInvalidValue\b/hipErrorInvalidValue/g;
$ft{'numeric_literal'} += s/\bcudaErrorLaunchFailure\b/hipErrorLaunchFailure/g;
$ft{'numeric_literal'} += s/\bcudaErrorLaunchOutOfResources\b/hipErrorLaunchOutOfResources/g;
$ft{'numeric_literal'} += s/\bcudaErrorLaunchTimeout\b/hipErrorLaunchTimeOut/g;
$ft{'numeric_literal'} += s/\bcudaErrorMapBufferObjectFailed\b/hipErrorMapBufferObjectFailed/g;
$ft{'numeric_literal'} += s/\bcudaErrorMemoryAllocation\b/hipErrorMemoryAllocation/g;
$ft{'numeric_literal'} += s/\bcudaErrorMapBufferObjectFailed\b/hipErrorMapFailed/g;
$ft{'numeric_literal'} += s/\bcudaErrorMemoryAllocation\b/hipErrorOutOfMemory/g;
$ft{'numeric_literal'} += s/\bcudaErrorMissingConfiguration\b/hipErrorMissingConfiguration/g;
$ft{'numeric_literal'} += s/\bcudaErrorNoDevice\b/hipErrorNoDevice/g;
$ft{'numeric_literal'} += s/\bcudaErrorNoKernelImageForDevice\b/hipErrorNoBinaryForGpu/g;
@@ -716,23 +716,23 @@
| enum |***`cudaError`*** | |***`hipError_t`*** |
| typedef |***`cudaError_t`*** | |***`hipError_t`*** |
| 0 |*`cudaSuccess`* | |*`hipSuccess`* |
| 1 |*`cudaErrorInvalidValue`* | |*`hipErrorInvalidValue`* | 1011 |
| 2 |*`cudaErrorMemoryAllocation`* | |*`hipErrorMemoryAllocation`* | 1002 |
| 3 |*`cudaErrorInitializationError`* | |*`hipErrorInitializationError`* | 1003 |
| 1 |*`cudaErrorInvalidValue`* | |*`hipErrorInvalidValue`* |
| 2 |*`cudaErrorMemoryAllocation`* | |*`hipErrorOutOfMemory`* |
| 3 |*`cudaErrorInitializationError`* | |*`hipErrorNotInitialized`* |
| 4 |*`cudaErrorCudartUnloading`* | |*`hipErrorDeinitialized`* |
| 5 |*`cudaErrorProfilerDisabled`* | |*`hipErrorProfilerDisabled`* |
| 6 |*`cudaErrorProfilerNotInitialized`* | |*`hipErrorProfilerNotInitialized`* |
| 7 |*`cudaErrorProfilerAlreadyStarted`* | |*`hipErrorProfilerAlreadyStarted`* |
| 8 |*`cudaErrorProfilerAlreadyStopped`* | |*`hipErrorProfilerAlreadyStopped`* |
| 9 |*`cudaErrorInvalidConfiguration`* | |*`hipErrorInvalidConfiguration`* | 1009 |
| 9 |*`cudaErrorInvalidConfiguration`* | |*`hipErrorInvalidConfiguration`* |
| 12 |*`cudaErrorInvalidPitchValue`* | | |
| 13 |*`cudaErrorInvalidSymbol`* | |*`hipErrorInvalidSymbol`* | 701 |
| 13 |*`cudaErrorInvalidSymbol`* | |*`hipErrorInvalidSymbol`* |
| 16 |*`cudaErrorInvalidHostPointer`* | | |
| 17 |*`cudaErrorInvalidDevicePointer`* | |*`hipErrorInvalidDevicePointer`* | 1017 |
| 17 |*`cudaErrorInvalidDevicePointer`* | |*`hipErrorInvalidDevicePointer`* |
| 18 |*`cudaErrorInvalidTexture`* | | |
| 19 |*`cudaErrorInvalidTextureBinding`* | | |
| 20 |*`cudaErrorInvalidChannelDescriptor`* | | |
| 21 |*`cudaErrorInvalidMemcpyDirection`* | |*`hipErrorInvalidMemcpyDirection`* | 1021 |
| 21 |*`cudaErrorInvalidMemcpyDirection`* | |*`hipErrorInvalidMemcpyDirection`* |
| 22 |*`cudaErrorAddressOfConstant`* | | |
| 23 |*`cudaErrorTextureFetchFailed`* | | |
| 24 |*`cudaErrorTextureNotBound`* | | |
@@ -749,20 +749,20 @@
| 45 |*`cudaErrorDuplicateSurfaceName`* | | |
| 46 |*`cudaErrorDevicesUnavailable`* | | |
| 49 |*`cudaErrorIncompatibleDriverContext`* | | |
| 52 |*`cudaErrorMissingConfiguration`* | |*`hipErrorMissingConfiguration`* | 1001 |
| 53 |*`cudaErrorPriorLaunchFailure`* | |*`hipErrorPriorLaunchFailure`* | 1005 |
| 52 |*`cudaErrorMissingConfiguration`* | |*`hipErrorMissingConfiguration`* |
| 53 |*`cudaErrorPriorLaunchFailure`* | |*`hipErrorPriorLaunchFailure`* |
| 65 |*`cudaErrorLaunchMaxDepthExceeded`* | | |
| 66 |*`cudaErrorLaunchFileScopedTex`* | | |
| 67 |*`cudaErrorLaunchFileScopedSurf`* | | |
| 68 |*`cudaErrorSyncDepthExceeded`* | | |
| 69 |*`cudaErrorLaunchPendingCountExceeded`* | | |
| 98 |*`cudaErrorInvalidDeviceFunction`* | |*`hipErrorInvalidDeviceFunction`* | 1008 |
| 100 |*`cudaErrorNoDevice`* | |*`hipErrorNoDevice`* | 1038 |
| 101 |*`cudaErrorInvalidDevice`* | |*`hipErrorInvalidDevice`* | 1010 |
| 98 |*`cudaErrorInvalidDeviceFunction`* | |*`hipErrorInvalidDeviceFunction`* |
| 100 |*`cudaErrorNoDevice`* | |*`hipErrorNoDevice`* |
| 101 |*`cudaErrorInvalidDevice`* | |*`hipErrorInvalidDevice`* |
| 127 |*`cudaErrorStartupFailure`* | 10.0 | |
| 200 |*`cudaErrorInvalidKernelImage`* | |*`hipErrorInvalidImage`* |
| 201 |*`cudaErrorDeviceUninitilialized`* | |*`hipErrorInvalidContext`* |
| 205 |*`cudaErrorMapBufferObjectFailed`* | |*`hipErrorMapBufferObjectFailed`* | 1071 |
| 205 |*`cudaErrorMapBufferObjectFailed`* | |*`hipErrorMapFailed`* |
| 206 |*`cudaErrorUnmapBufferObjectFailed`* | |*`hipErrorUnmapFailed`* |
| 209 |*`cudaErrorNoKernelImageForDevice`* | |*`hipErrorNoBinaryForGpu`* |
| 214 |*`cudaErrorECCUncorrectable`* | |*`hipErrorECCNotCorrectable`* |
@@ -778,31 +778,31 @@
| 302 |*`cudaErrorSharedObjectSymbolNotFound`* | |*`hipErrorSharedObjectSymbolNotFound`* |
| 303 |*`cudaErrorSharedObjectInitFailed`* | |*`hipErrorSharedObjectInitFailed`* |
| 304 |*`cudaErrorOperatingSystem`* | |*`hipErrorOperatingSystem`* |
| 400 |*`cudaErrorInvalidResourceHandle`* | |*`hipErrorInvalidResourceHandle`* | 1033 |
| 400 |*`cudaErrorInvalidResourceHandle`* | |*`hipErrorInvalidHandle`* |
| 401 |*`cudaErrorIllegalState`* | 10.0 | |
| 500 |*`cudaErrorSymbolNotFound`* | 10.1 |*`hipErrorNotFound`* |
| 600 |*`cudaErrorNotReady`* | |*`hipErrorNotReady`* | 1034 |
| 600 |*`cudaErrorNotReady`* | |*`hipErrorNotReady`* |
| 700 |*`cudaErrorIllegalAddress`* | |*`hipErrorIllegalAddress`* |
| 701 |*`cudaErrorLaunchOutOfResources`* | |*`hipErrorLaunchOutOfResources`* | 1007 |
| 702 |*`cudaErrorLaunchTimeout`* | |*`hipErrorLaunchTimeOut`* | 1006 |
| 701 |*`cudaErrorLaunchOutOfResources`* | |*`hipErrorLaunchOutOfResources`* |
| 702 |*`cudaErrorLaunchTimeout`* | |*`hipErrorLaunchTimeOut`* |
| 703 |*`cudaErrorLaunchIncompatibleTexturing`* | | |
| 704 |*`cudaErrorPeerAccessAlreadyEnabled`* | |*`hipErrorPeerAccessAlreadyEnabled`* | 1050 |
| 705 |*`cudaErrorPeerAccessNotEnabled`* | |*`hipErrorPeerAccessNotEnabled`* | 1051 |
| 708 |*`cudaErrorSetOnActiveProcess`* | |*`hipErrorSetOnActiveProcess`* | 305 |
| 704 |*`cudaErrorPeerAccessAlreadyEnabled`* | |*`hipErrorPeerAccessAlreadyEnabled`* |
| 705 |*`cudaErrorPeerAccessNotEnabled`* | |*`hipErrorPeerAccessNotEnabled`* |
| 708 |*`cudaErrorSetOnActiveProcess`* | |*`hipErrorSetOnActiveProcess`* |
| 709 |*`cudaErrorContextIsDestroyed`* | | |
| 710 |*`cudaErrorAssert`* | |*`hipErrorAssert`* | 1081 |
| 710 |*`cudaErrorAssert`* | |*`hipErrorAssert`* |
| 711 |*`cudaErrorTooManyPeers`* | | |
| 712 |*`cudaErrorHostMemoryAlreadyRegistered`* | |*`hipErrorHostMemoryAlreadyRegistered`* | 1061 |
| 713 |*`cudaErrorHostMemoryNotRegistered`* | |*`hipErrorHostMemoryNotRegistered`* | 1062 |
| 712 |*`cudaErrorHostMemoryAlreadyRegistered`* | |*`hipErrorHostMemoryAlreadyRegistered`* |
| 713 |*`cudaErrorHostMemoryNotRegistered`* | |*`hipErrorHostMemoryNotRegistered`* |
| 714 |*`cudaErrorHardwareStackError`* | | |
| 715 |*`cudaErrorIllegalInstruction`* | | |
| 716 |*`cudaErrorMisalignedAddress`* | | |
| 717 |*`cudaErrorInvalidAddressSpace`* | | |
| 718 |*`cudaErrorInvalidPc`* | | |
| 719 |*`cudaErrorLaunchFailure`* | |*`hipErrorLaunchFailure`* | 1004 |
| 719 |*`cudaErrorLaunchFailure`* | |*`hipErrorLaunchFailure`* |
| 720 |*`cudaErrorCooperativeLaunchTooLarge`* | 9.0 | |
| 800 |*`cudaErrorNotPermitted`* | | |
| 801 |*`cudaErrorNotSupported`* | |*`hipErrorNotSupported`* | 1082 |
| 801 |*`cudaErrorNotSupported`* | |*`hipErrorNotSupported`* |
| 802 |*`cudaErrorSystemNotReady`* | 10.0 | |
| 803 |*`cudaErrorSystemDriverMismatch`* | 10.0 | |
| 804 |*`cudaErrorCompatNotSupportedOnDevice`* | 10.0 | |
@@ -817,7 +817,7 @@
| 908 |*`cudaErrorStreamCaptureWrongThread`* | 10.1 | |
| 909 |*`cudaErrorTimeout`* | 10.2 | |
| 910 |*`cudaErrorGraphExecUpdateFailure`* | 10.2 | |
| 999 |*`cudaErrorUnknown`* | |*`hipErrorUnknown`* | 1030 |
| 999 |*`cudaErrorUnknown`* | |*`hipErrorUnknown`* |
| 10000 |*`cudaErrorApiFailureBase`* | | |
| enum |***`cudaFuncCache`*** | |***`hipFuncCache_t`*** |
| 0 |*`cudaFuncCachePreferNone`* | |*`hipFuncCachePreferNone`* |
@@ -1166,16 +1166,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
// CUresult enum values
// cudaSuccess
{"CUDA_SUCCESS", {"hipSuccess", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 0
// cudaErrorInvalidValue = 1, CUDA_ERROR_INVALID_VALUE = 1, hipErrorInvalidValue = 1011
// TODO [HIP]: make hipErrorInvalidValue = 1
// cudaErrorInvalidValue
{"CUDA_ERROR_INVALID_VALUE", {"hipErrorInvalidValue", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 1
// cudaErrorMemoryAllocation = 2, CUDA_ERROR_OUT_OF_MEMORY = 2, hipErrorOutOfMemory = 2, hipErrorMemoryAllocation = 1002
// TODO [HIP]: remove hipErrorMemoryAllocation
// cudaErrorMemoryAllocation
{"CUDA_ERROR_OUT_OF_MEMORY", {"hipErrorOutOfMemory", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 2
// cudaErrorInitializationError = 3, CUDA_ERROR_NOT_INITIALIZED = 3, hipErrorNotInitialized = 3, hipErrorInitializationError = 1003
// TODO [HIP]: remove hipErrorInitializationError
// cudaErrorInitializationError
{"CUDA_ERROR_NOT_INITIALIZED", {"hipErrorNotInitialized", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 3
// cudaErrorCudartUnloading
@@ -1191,12 +1185,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
// cudaErrorProfilerAlreadyStopped
// NOTE: Deprecated since CUDA 5.0
{"CUDA_ERROR_PROFILER_ALREADY_STOPPED", {"hipErrorProfilerAlreadyStopped", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 8
// cudaErrorNoDevice = 100, CUDA_ERROR_NO_DEVICE = 100, hipErrorNoDevice = 1038
// TODO [HIP]: make hipErrorNoDevice = 100
// cudaErrorNoDevice
{"CUDA_ERROR_NO_DEVICE", {"hipErrorNoDevice", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 100
// cudaErrorInvalidDevice = 101, CUDA_ERROR_INVALID_DEVICE = 101, hipErrorInvalidDevice = 1010
// TODO [HIP]: make hipErrorInvalidDevice = 101
// cudaErrorInvalidDevice
{"CUDA_ERROR_INVALID_DEVICE", {"hipErrorInvalidDevice", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 101
// cudaErrorInvalidKernelImage
@@ -1206,9 +1196,6 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
// no analogue
// NOTE: Deprecated since CUDA 3.2
{"CUDA_ERROR_CONTEXT_ALREADY_CURRENT", {"hipErrorContextAlreadyCurrent", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 202
// cudaErrorMapBufferObjectFailed = 205, CUDA_ERROR_MAP_FAILED = 205, hipErrorMapFailed = 205, hipErrorMapBufferObjectFailed = 1071
// TODO [HIP]: remove hipErrorMapBufferObjectFailed
// TODO [HIPIFY]: rename hipErrorMapBufferObjectFailed to hipErrorMapFailed
// cudaErrorMapBufferObjectFailed
{"CUDA_ERROR_MAP_FAILED", {"hipErrorMapFailed", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 205
// cudaErrorUnmapBufferObjectFailed
@@ -1253,57 +1240,36 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
{"CUDA_ERROR_SHARED_OBJECT_INIT_FAILED", {"hipErrorSharedObjectInitFailed", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 303
// cudaErrorOperatingSystem
{"CUDA_ERROR_OPERATING_SYSTEM", {"hipErrorOperatingSystem", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 304
// cudaErrorInvalidResourceHandle = 400, CUDA_ERROR_INVALID_HANDLE = 400, hipErrorInvalidHandle = 400, hipErrorInvalidResourceHandle = 1033
// TODO [HIP]: remove hipErrorInvalidResourceHandle
// TODO [HIPIFY]: rename hipErrorInvalidResourceHandle to hipErrorInvalidHandle
// cudaErrorInvalidResourceHandle
{"CUDA_ERROR_INVALID_HANDLE", {"hipErrorInvalidHandle", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 400
// cudaErrorIllegalState
{"CUDA_ERROR_ILLEGAL_STATE", {"hipErrorIllegalState", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 401
// cudaErrorSymbolNotFound
{"CUDA_ERROR_NOT_FOUND", {"hipErrorNotFound", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 500
// cudaErrorNotReady = 600, CUDA_ERROR_NOT_READY = 600, hipErrorNotReady = 1034
// TODO [HIP]: make hipErrorNotReady = 600
// cudaErrorNotReady
{"CUDA_ERROR_NOT_READY", {"hipErrorNotReady", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 600
// cudaErrorIllegalAddress
{"CUDA_ERROR_ILLEGAL_ADDRESS", {"hipErrorIllegalAddress", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 700
// cudaErrorLaunchOutOfResources = 701, CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701, hipErrorLaunchOutOfResources = 1007
// TODO [HIP]: make hipErrorLaunchOutOfResources = 701
// cudaErrorLaunchOutOfResources
{"CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES", {"hipErrorLaunchOutOfResources", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 701
// cudaErrorLaunchTimeout = 702, CUDA_ERROR_LAUNCH_TIMEOUT = 702, hipErrorLaunchTimeOut = 1006
// TODO [HIP]: make hipErrorLaunchTimeOut = 702
// cudaErrorLaunchTimeout
{"CUDA_ERROR_LAUNCH_TIMEOUT", {"hipErrorLaunchTimeOut", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 702
// cudaErrorLaunchIncompatibleTexturing
{"CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING", {"hipErrorLaunchIncompatibleTexturing", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 703
// cudaErrorPeerAccessAlreadyEnabled = 704, CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704, hipErrorPeerAccessAlreadyEnabled = 1050
// TODO [HIP]: make hipErrorPeerAccessAlreadyEnabled = 704
// cudaErrorPeerAccessAlreadyEnabled
{"CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED", {"hipErrorPeerAccessAlreadyEnabled", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 704
// cudaErrorPeerAccessNotEnabled = 705, CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705, hipErrorPeerAccessNotEnabled = 1051
// TODO [HIP]: make hipErrorPeerAccessNotEnabled = 705
// cudaErrorPeerAccessNotEnabled
{"CUDA_ERROR_PEER_ACCESS_NOT_ENABLED", {"hipErrorPeerAccessNotEnabled", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 705
// cudaErrorSetOnActiveProcess = 708, CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708, hipErrorSetOnActiveProcess = 305
// TODO [HIP]: make hipErrorSetOnActiveProcess = 708
// cudaErrorSetOnActiveProcess
{"CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE", {"hipErrorSetOnActiveProcess", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 708
// cudaErrorContextIsDestroyed
{"CUDA_ERROR_CONTEXT_IS_DESTROYED", {"hipErrorContextIsDestroyed", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 709
// cudaErrorAssert = 710, CUDA_ERROR_ASSERT = 710, hipErrorAssert = 1081
// TODO [HIP]: make hipErrorAssert = 710
// cudaErrorAssert
{"CUDA_ERROR_ASSERT", {"hipErrorAssert", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 710
// cudaErrorTooManyPeers
{"CUDA_ERROR_TOO_MANY_PEERS", {"hipErrorTooManyPeers", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 711
// cudaErrorHostMemoryAlreadyRegistered = 712, CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712, hipErrorHostMemoryAlreadyRegistered = 1061
// TODO [HIP]: make hipErrorHostMemoryAlreadyRegistered = 712
// cudaErrorHostMemoryAlreadyRegistered
{"CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED", {"hipErrorHostMemoryAlreadyRegistered", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 712
// cudaErrorHostMemoryNotRegistered = 713, CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713, hipErrorHostMemoryNotRegistered = 1062
// TODO [HIP]: make hipErrorHostMemoryNotRegistered = 713
// cudaErrorHostMemoryNotRegistered
{"CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED", {"hipErrorHostMemoryNotRegistered", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 713
// cudaErrorHardwareStackError
@@ -1316,14 +1282,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
{"CUDA_ERROR_INVALID_ADDRESS_SPACE", {"hipErrorInvalidAddressSpace", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 717
// cudaErrorInvalidPc
{"CUDA_ERROR_INVALID_PC", {"hipErrorInvalidPc", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 718
// cudaErrorLaunchFailure = 719, CUDA_ERROR_LAUNCH_FAILED = 719, hipErrorLaunchFailure = 1004
// TODO [HIP]: make hipErrorSetOnActiveProcess = 719
// cudaErrorLaunchFailure
{"CUDA_ERROR_LAUNCH_FAILED", {"hipErrorLaunchFailure", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 719
// cudaErrorNotPermitted
{"CUDA_ERROR_NOT_PERMITTED", {"hipErrorNotPermitted", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 800
// cudaErrorNotSupported = 801, CUDA_ERROR_NOT_SUPPORTED = 801, hipErrorNotSupported = 1082
// TODO [HIP]: make hipErrorNotSupported = 801
// cudaErrorNotSupported
{"CUDA_ERROR_NOT_SUPPORTED", {"hipErrorNotSupported", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 801
// cudaErrorSystemNotReady
@@ -1354,8 +1316,6 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP{
{"CUDA_ERROR_TIMEOUT", {"hipErrorTimeout", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 909
// cudaErrorGraphExecUpdateFailure
{"CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE", {"hipErrorGraphExecUpdateFailure", "", CONV_NUMERIC_LITERAL, API_DRIVER, HIP_UNSUPPORTED}}, // 910
// cudaErrorUnknown = 999, CUDA_ERROR_UNKNOWN = 999, hipErrorUnknown = 1030
// TODO [HIP]: make hipErrorUnknown = 999
// cudaErrorUnknown
{"CUDA_ERROR_UNKNOWN", {"hipErrorUnknown", "", CONV_NUMERIC_LITERAL, API_DRIVER}}, // 999
@@ -599,16 +599,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_TYPE_NAME_MAP {
{"cudaSuccess", {"hipSuccess", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 0
// CUDA_ERROR_INVALID_VALUE
{"cudaErrorInvalidValue", {"hipErrorInvalidValue", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 1
// cudaErrorMemoryAllocation = 2, CUDA_ERROR_OUT_OF_MEMORY = 2, hipErrorOutOfMemory = 2, hipErrorMemoryAllocation = 1002
// TODO [HIP]: remove hipErrorMemoryAllocation
// TODO [HIPIFY]: rename hipErrorMemoryAllocation to hipErrorOutOfMemory
// CUDA_ERROR_OUT_OF_MEMORY
{"cudaErrorMemoryAllocation", {"hipErrorMemoryAllocation", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 2
// cudaErrorInitializationError = 3, CUDA_ERROR_NOT_INITIALIZED = 3, hipErrorNotInitialized = 3, hipErrorInitializationError = 1003
// TODO [HIP]: remove hipErrorInitializationError
// TODO [HIPIFY]: rename hipErrorInitializationError to hipErrorNotInitialized
{"cudaErrorMemoryAllocation", {"hipErrorOutOfMemory", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 2
// CUDA_ERROR_NOT_INITIALIZED
{"cudaErrorInitializationError", {"hipErrorInitializationError", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 3
{"cudaErrorInitializationError", {"hipErrorNotInitialized", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 3
// CUDA_ERROR_DEINITIALIZED
{"cudaErrorCudartUnloading", {"hipErrorDeinitialized", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 4
// CUDA_ERROR_PROFILER_DISABLED
@@ -705,11 +699,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_TYPE_NAME_MAP {
{"cudaErrorDeviceUninitialized", {"hipErrorInvalidContext", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 201
// CUDA_ERROR_INVALID_CONTEXT
{"cudaErrorDeviceUninitilialized", {"hipErrorInvalidContext", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 201
// cudaErrorMapBufferObjectFailed = 205, CUDA_ERROR_MAP_FAILED = 205, hipErrorMapFailed = 205, hipErrorMapBufferObjectFailed = 1071
// TODO [HIP]: remove hipErrorMapBufferObjectFailed
// TODO [HIPIFY]: rename hipErrorMapBufferObjectFailed to hipErrorMapFailed
// CUDA_ERROR_MAP_FAILED
{"cudaErrorMapBufferObjectFailed", {"hipErrorMapBufferObjectFailed", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 205
{"cudaErrorMapBufferObjectFailed", {"hipErrorMapFailed", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 205
// CUDA_ERROR_UNMAP_FAILED
{"cudaErrorUnmapBufferObjectFailed", {"hipErrorUnmapFailed", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 206
// CUDA_ERROR_ARRAY_IS_MAPPED
@@ -752,11 +743,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_RUNTIME_TYPE_NAME_MAP {
{"cudaErrorSharedObjectInitFailed", {"hipErrorSharedObjectInitFailed", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 303
// CUDA_ERROR_OPERATING_SYSTEM
{"cudaErrorOperatingSystem", {"hipErrorOperatingSystem", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 304
// cudaErrorInvalidResourceHandle = 400, CUDA_ERROR_INVALID_HANDLE = 400, hipErrorInvalidHandle = 400, hipErrorInvalidResourceHandle = 1033
// TODO [HIP]: remove hipErrorInvalidResourceHandle
// TODO [HIPIFY]: rename hipErrorInvalidResourceHandle to hipErrorInvalidHandle
// CUDA_ERROR_INVALID_HANDLE
{"cudaErrorInvalidResourceHandle", {"hipErrorInvalidResourceHandle", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 400
{"cudaErrorInvalidResourceHandle", {"hipErrorInvalidHandle", "", CONV_NUMERIC_LITERAL, API_RUNTIME}}, // 400
// CUDA_ERROR_ILLEGAL_STATE
{"cudaErrorIllegalState", {"hipErrorIllegalState", "", CONV_NUMERIC_LITERAL, API_RUNTIME, HIP_UNSUPPORTED}}, // 401
// CUDA_ERROR_NOT_FOUND
+9 -7
查看文件
@@ -186,7 +186,11 @@ typedef enum __HIP_NODISCARD hipError_t {
hipErrorInvalidValue = 1, ///< One or more of the parameters passed to the API call is NULL
///< or not in an acceptable range.
hipErrorOutOfMemory = 2,
// Deprecated
hipErrorMemoryAllocation = 2, ///< Memory allocation error.
hipErrorNotInitialized = 3,
// Deprecated
hipErrorInitializationError = 3,
hipErrorDeinitialized = 4,
hipErrorProfilerDisabled = 5,
hipErrorProfilerNotInitialized = 6,
@@ -206,6 +210,8 @@ typedef enum __HIP_NODISCARD hipError_t {
hipErrorInvalidContext = 201, ///< Produced when input context is invalid.
hipErrorContextAlreadyCurrent = 202,
hipErrorMapFailed = 205,
// Deprecated
hipErrorMapBufferObjectFailed = 205 ///< Produced when the IPC memory attach failed from ROCr.
hipErrorUnmapFailed = 206,
hipErrorArrayIsMapped = 207,
hipErrorAlreadyMapped = 208,
@@ -226,6 +232,8 @@ typedef enum __HIP_NODISCARD hipError_t {
hipErrorSharedObjectInitFailed = 303,
hipErrorOperatingSystem = 304,
hipErrorInvalidHandle = 400,
// Deprecated
hipErrorInvalidResourceHandle = 400, ///< Resource handle (hipEvent_t or hipStream_t) invalid.
hipErrorNotFound = 500,
hipErrorNotReady = 600, ///< Indicates that asynchronous operations enqueued earlier are not
///< ready. This is not actually an error, but is used to distinguish
@@ -248,17 +256,11 @@ typedef enum __HIP_NODISCARD hipError_t {
719, ///< An exception occurred on the device while executing a kernel.
hipErrorNotSupported = 801, ///< Produced when the hip API is not supported/implemented
hipErrorUnknown = 999, //< Unknown error.
// Runtime Error Codes start here.
hipErrorMemoryAllocation = 1002, ///< Memory allocation error.
hipErrorInitializationError = 1003, ///< TODO comment from hipErrorInitializationError
hipErrorInvalidResourceHandle = 1033, ///< Resource handle (hipEvent_t or hipStream_t) invalid.
// HSA Runtime Error Codes start here.
hipErrorRuntimeMemory = 1052, ///< HSA runtime memory call returned error. Typically not seen
///< in production systems.
hipErrorRuntimeOther = 1053, ///< HSA runtime call other than memory returned error. Typically
///< not seen in production systems.
hipErrorMapBufferObjectFailed =
1071, ///< Produced when the IPC memory attach failed from ROCr.
hipErrorTbd ///< Marker that more error codes are needed.
} hipError_t;
@@ -67,11 +67,11 @@ int main(int argc, char *argv[])
printf ("info: allocate host mem (%6.2f MB)\n", 2*Nbytes/1024.0/1024.0);
A_h = (float*)malloc(Nbytes);
// CHECK: CHECK(A_h == 0 ? hipErrorMemoryAllocation : hipSuccess );
// CHECK: CHECK(A_h == 0 ? hipErrorOutOfMemory : hipSuccess );
CHECK(A_h == 0 ? cudaErrorMemoryAllocation : cudaSuccess );
C_h = (float*)malloc(Nbytes);
// CHECK: CHECK(C_h == 0 ? hipErrorMemoryAllocation : hipSuccess );
// CHECK: CHECK(C_h == 0 ? hipErrorOutOfMemory : hipSuccess );
CHECK(C_h == 0 ? cudaErrorMemoryAllocation : cudaSuccess );
// Fill with Phi + i
for (size_t i=0; i<N; i++)