Skip to content

Commit

Permalink
Merge pull request ROCm#1235 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY] Sync with CUDA 12.3.0 - Step 4 - Runtime API data types
  • Loading branch information
emankov authored Dec 26, 2023
2 parents 30236ba + 52daa7d commit 3fb34aa
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 13 deletions.
12 changes: 12 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -6219,6 +6219,7 @@ sub simpleSubstitutions {
subst("cudaErrorLaunchFailure", "hipErrorLaunchFailure", "numeric_literal");
subst("cudaErrorLaunchOutOfResources", "hipErrorLaunchOutOfResources", "numeric_literal");
subst("cudaErrorLaunchTimeout", "hipErrorLaunchTimeOut", "numeric_literal");
subst("cudaErrorLossyQuery", "hipErrorLossyQuery", "numeric_literal");
subst("cudaErrorMapBufferObjectFailed", "hipErrorMapFailed", "numeric_literal");
subst("cudaErrorMemoryAllocation", "hipErrorOutOfMemory", "numeric_literal");
subst("cudaErrorMissingConfiguration", "hipErrorMissingConfiguration", "numeric_literal");
Expand Down Expand Up @@ -6302,6 +6303,7 @@ sub simpleSubstitutions {
subst("cudaGraphMemAttrReservedMemHigh", "hipGraphMemAttrReservedMemHigh", "numeric_literal");
subst("cudaGraphMemAttrUsedMemCurrent", "hipGraphMemAttrUsedMemCurrent", "numeric_literal");
subst("cudaGraphMemAttrUsedMemHigh", "hipGraphMemAttrUsedMemHigh", "numeric_literal");
subst("cudaGraphNodeTypeConditional", "hipGraphNodeTypeConditional", "numeric_literal");
subst("cudaGraphNodeTypeCount", "hipGraphNodeTypeCount", "numeric_literal");
subst("cudaGraphNodeTypeEmpty", "hipGraphNodeTypeEmpty", "numeric_literal");
subst("cudaGraphNodeTypeEventRecord", "hipGraphNodeTypeEventRecord", "numeric_literal");
Expand Down Expand Up @@ -8388,6 +8390,8 @@ sub warnUnsupportedFunctions {
"cudaMemLocationTypeHostNuma",
"cudaMemLocationTypeHost",
"cudaMemFreeNodeParams",
"cudaMemFabricHandle_t",
"cudaMemFabricHandle_st",
"cudaMemAllocNodeParamsV2",
"cudaMemAdvise_v2",
"cudaLimitPersistingL2CacheSize",
Expand Down Expand Up @@ -8466,6 +8470,12 @@ sub warnUnsupportedFunctions {
"cudaGraphExecUpdateErrorAttributesChanged",
"cudaGraphExecNodeSetParams",
"cudaGraphExecGetFlags",
"cudaGraphConditionalNodeType",
"cudaGraphConditionalHandleFlags",
"cudaGraphConditionalHandle",
"cudaGraphCondTypeWhile",
"cudaGraphCondTypeIf",
"cudaGraphCondAssignDefault",
"cudaGraphAddNode",
"cudaGetTextureObjectTextureDesc_v2",
"cudaGetSurfaceReference",
Expand Down Expand Up @@ -8708,6 +8718,7 @@ sub warnUnsupportedFunctions {
"cudaDevAttrReserved122",
"cudaDevAttrNumaId",
"cudaDevAttrNumaConfig",
"cudaDevAttrMpsEnabled",
"cudaDevAttrMemoryPoolSupportedHandleTypes",
"cudaDevAttrMemSyncDomainCount",
"cudaDevAttrMaxTimelineSemaphoreInteropSupported",
Expand Down Expand Up @@ -8789,6 +8800,7 @@ sub warnUnsupportedFunctions {
"cudaD3D10DeviceList",
"cudaCtxResetPersistingL2Cache",
"cudaCreateTextureObject_v2",
"cudaConditionalNodeParams",
"cudaClusterSchedulingPolicySpread",
"cudaClusterSchedulingPolicyLoadBalancing",
"cudaClusterSchedulingPolicyDefault",
Expand Down
12 changes: 12 additions & 0 deletions docs/tables/CUDA_Runtime_API_functions_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@
|`cudaComputeModeExclusive`| | | | |`hipComputeModeExclusive`|1.9.0| | | | |
|`cudaComputeModeExclusiveProcess`| | | | |`hipComputeModeExclusiveProcess`|2.0.0| | | | |
|`cudaComputeModeProhibited`| | | | |`hipComputeModeProhibited`|1.9.0| | | | |
|`cudaConditionalNodeParams`|12.3| | | | | | | | | |
|`cudaCooperativeLaunchMultiDeviceNoPostSync`|9.0| | | |`hipCooperativeLaunchMultiDeviceNoPostSync`|3.2.0| | | | |
|`cudaCooperativeLaunchMultiDeviceNoPreSync`|9.0| | | |`hipCooperativeLaunchMultiDeviceNoPreSync`|3.2.0| | | | |
|`cudaCpuDeviceId`|8.0| | | |`hipCpuDeviceId`|3.7.0| | | | |
Expand Down Expand Up @@ -736,6 +737,7 @@
|`cudaDevAttrMemoryClockRate`| | | | |`hipDeviceAttributeMemoryClockRate`|1.6.0| | | | |
|`cudaDevAttrMemoryPoolSupportedHandleTypes`|11.3| | | | | | | | | |
|`cudaDevAttrMemoryPoolsSupported`|11.2| | | |`hipDeviceAttributeMemoryPoolsSupported`|5.2.0| | | | |
|`cudaDevAttrMpsEnabled`|12.3| | | | | | | | | |
|`cudaDevAttrMultiGpuBoardGroupID`| | | | |`hipDeviceAttributeMultiGpuBoardGroupID`|5.0.0| | | | |
|`cudaDevAttrMultiProcessorCount`| | | | |`hipDeviceAttributeMultiprocessorCount`|1.6.0| | | | |
|`cudaDevAttrNumaConfig`|12.2| | | | | | | | | |
Expand Down Expand Up @@ -947,6 +949,7 @@
|`cudaErrorLaunchOutOfResources`| | | | |`hipErrorLaunchOutOfResources`|1.6.0| | | | |
|`cudaErrorLaunchPendingCountExceeded`| | | | | | | | | | |
|`cudaErrorLaunchTimeout`| | | | |`hipErrorLaunchTimeOut`|1.6.0| | | | |
|`cudaErrorLossyQuery`|12.3| | | |`hipErrorLossyQuery`| | | | | |
|`cudaErrorMapBufferObjectFailed`| | | | |`hipErrorMapFailed`|1.6.0| | | | |
|`cudaErrorMemoryAllocation`| | | | |`hipErrorOutOfMemory`|1.6.0| | | | |
|`cudaErrorMemoryValueTooLarge`| |3.1| | | | | | | | |
Expand Down Expand Up @@ -1099,6 +1102,12 @@
|`cudaGPUDirectRDMAWritesOrderingNone`|11.3| | | | | | | | | |
|`cudaGPUDirectRDMAWritesOrderingOwner`|11.3| | | | | | | | | |
|`cudaGetDriverEntryPointFlags`|11.3| | | | | | | | | |
|`cudaGraphCondAssignDefault`|12.3| | | | | | | | | |
|`cudaGraphCondTypeIf`|12.3| | | | | | | | | |
|`cudaGraphCondTypeWhile`|12.3| | | | | | | | | |
|`cudaGraphConditionalHandle`|12.3| | | | | | | | | |
|`cudaGraphConditionalHandleFlags`|12.3| | | | | | | | | |
|`cudaGraphConditionalNodeType`|12.3| | | | | | | | | |
|`cudaGraphDebugDotFlags`|11.3| | | |`hipGraphDebugDotFlags`|5.5.0| | | | |
|`cudaGraphDebugDotFlagsEventNodeParams`|11.3| | | |`hipGraphDebugDotFlagsEventNodeParams`|5.5.0| | | | |
|`cudaGraphDebugDotFlagsExtSemasSignalNodeParams`|11.3| | | |`hipGraphDebugDotFlagsExtSemasSignalNodeParams`|5.5.0| | | | |
Expand Down Expand Up @@ -1143,6 +1152,7 @@
|`cudaGraphMemAttributeType`|11.4| | | |`hipGraphMemAttributeType`|5.3.0| | | | |
|`cudaGraphNodeParams`|12.2| | | | | | | | | |
|`cudaGraphNodeType`|10.0| | | |`hipGraphNodeType`|4.3.0| | | | |
|`cudaGraphNodeTypeConditional`|12.3| | | |`hipGraphNodeTypeConditional`| | | | | |
|`cudaGraphNodeTypeCount`|10.0| | | |`hipGraphNodeTypeCount`|4.3.0| | | | |
|`cudaGraphNodeTypeEmpty`|10.0| | | |`hipGraphNodeTypeEmpty`|4.3.0| | | | |
|`cudaGraphNodeTypeEventRecord`|11.1| | | |`hipGraphNodeTypeEventRecord`|4.3.0| | | | |
Expand Down Expand Up @@ -1262,6 +1272,8 @@
|`cudaMemAttachGlobal`| | | | |`hipMemAttachGlobal`|2.5.0| | | | |
|`cudaMemAttachHost`| | | | |`hipMemAttachHost`|2.5.0| | | | |
|`cudaMemAttachSingle`| | | | |`hipMemAttachSingle`|3.7.0| | | | |
|`cudaMemFabricHandle_st`|12.3| | | | | | | | | |
|`cudaMemFabricHandle_t`|12.3| | | | | | | | | |
|`cudaMemFreeNodeParams`|12.2| | | | | | | | | |
|`cudaMemHandleTypeNone`|11.2| | | |`hipMemHandleTypeNone`|5.2.0| | | | |
|`cudaMemHandleTypePosixFileDescriptor`|11.2| | | |`hipMemHandleTypePosixFileDescriptor`|5.2.0| | | | |
Expand Down
26 changes: 13 additions & 13 deletions src/CUDA2HIP_Driver_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,14 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
//
{"CUmulticastObjectProp", {"hipMulticastObjectProperties", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

//
// cudaMemFabricHandle_st
{"CUmemFabricHandle_st", {"hipMemFabricHandle", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},
//
// cudaMemFabricHandle_t
{"CUmemFabricHandle_v1", {"hipMemFabricHandle", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},
//
// cudaMemFabricHandle_t
{"CUmemFabricHandle", {"hipMemFabricHandle", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

//
// cudaConditionalNodeParams
{"CUDA_CONDITIONAL_NODE_PARAMS", {"hipConditionalNodeParams", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

//
Expand Down Expand Up @@ -897,9 +897,9 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
{"CU_DEVICE_ATTRIBUTE_NUMA_CONFIG", {"hipDeviceAttributeNumaConfig", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 130
// cudaDevAttrNumaId
{"CU_DEVICE_ATTRIBUTE_NUMA_ID", {"hipDeviceAttributeNumaId", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 131
//
// cudaDevAttrReserved132
{"CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED", {"hipDeviceAttributeMulticastSupported", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 132
//
// cudaDevAttrMpsEnabled
{"CU_DEVICE_ATTRIBUTE_MPS_ENABLED", {"hipDeviceAttributeMpsEnables", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 133
// cudaDevAttrHostNumaId
{"CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID", {"hipDeviceAttributeHostNumaId", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 134
Expand Down Expand Up @@ -1271,7 +1271,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
{"CU_GRAPH_NODE_TYPE_MEM_FREE", {"hipGraphNodeTypeMemFree", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES}}, // 11
//
{"CU_GRAPH_NODE_TYPE_BATCH_MEM_OP", {"hipGraphNodeTypeBatchMemOp", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 12
//
// cudaGraphNodeTypeConditional
{"CU_GRAPH_NODE_TYPE_CONDITIONAL", {"hipGraphNodeTypeConditional", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 13
// cudaGraphNodeTypeCount
{"CU_GRAPH_NODE_TYPE_COUNT", {"hipGraphNodeTypeCount", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, CUDA_REMOVED}},
Expand Down Expand Up @@ -1713,8 +1713,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
{"CUDA_ERROR_INVALID_HANDLE", {"hipErrorInvalidHandle", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES}}, // 400
// cudaErrorIllegalState
{"CUDA_ERROR_ILLEGAL_STATE", {"hipErrorIllegalState", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES}}, // 401
//
{"CUDA_ERROR_LOSSY_QUERY", {"hipErrorIllegalState", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 402
// cudaErrorLossyQuery
{"CUDA_ERROR_LOSSY_QUERY", {"hipErrorLossyQuery", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 402
// cudaErrorSymbolNotFound
{"CUDA_ERROR_NOT_FOUND", {"hipErrorNotFound", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES}}, // 500
// cudaErrorNotReady
Expand Down Expand Up @@ -2576,13 +2576,13 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
// cudaDeviceNumaConfigNumaNode
{"CU_DEVICE_NUMA_CONFIG_NUMA_NODE", {"hipDeviceNumaConfigNumaNode", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

//
// cudaGraphConditionalNodeType
{"CUgraphConditionalNodeType", {"hipGraphConditionalNodeType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},
{"CUgraphConditionalNodeType_enum", {"hipGraphConditionalNodeType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},
// CUgraphConditionalNodeType enum values
//
// cudaGraphCondTypeIf
{"CU_GRAPH_COND_TYPE_IF", {"hipGraphCondTypeIf", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},
//
// cudaGraphCondTypeWhile
{"CU_GRAPH_COND_TYPE_WHILE", {"hipGraphCondTypeWhile", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

//
Expand Down Expand Up @@ -2630,7 +2630,7 @@ const std::map<llvm::StringRef, hipCounter> CUDA_DRIVER_TYPE_NAME_MAP {
// GLenum
{"GLenum", {"GLenum", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES}},

// CUgraphConditionalHandle
// cudaGraphConditionalHandle
{"CUgraphConditionalHandle", {"hipGraphConditionalHandle", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}},

// 5. Defines
Expand Down
Loading

0 comments on commit 3fb34aa

Please sign in to comment.