From ec11cdd37cb7f9f0a1f06ab221ef59c4f71a891d Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Thu, 19 Dec 2024 19:08:57 +0100 Subject: [PATCH] [HIPIFY][RT][6.4.0] Sync with `HIP LRT 6.4.0` + Updated synthetic tests, the regenerated `hipify-perl`, and `Driver` and `Runtime` `CUDA2HIP` docs accordingly --- bin/hipify-perl | 26 +++++++++++++++++++ ...A_Driver_API_functions_supported_by_HIP.md | 20 +++++++------- ..._Runtime_API_functions_supported_by_HIP.md | 6 ++--- src/CUDA2HIP_Driver_API_functions.cpp | 3 ++- src/CUDA2HIP_Driver_API_types.cpp | 26 ++++++++++++------- src/CUDA2HIP_Runtime_API_functions.cpp | 2 +- src/CUDA2HIP_Runtime_API_types.cpp | 6 +++-- tests/unit_tests/synthetic/driver_enums.cu | 22 ++++++++++++++++ .../unit_tests/synthetic/driver_functions.cu | 8 ++++++ tests/unit_tests/synthetic/runtime_enums.cu | 4 +++ .../unit_tests/synthetic/runtime_functions.cu | 5 ++++ 11 files changed, 102 insertions(+), 26 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index 36006f3f..fb11cec5 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1398,15 +1398,28 @@ my %removed_funcs = ( ); my %experimental_funcs = ( + "cudaEventRecordWithFlags" => "6.4.0", + "cudaErrorInvalidTexture" => "6.4.0", + "cudaErrorInvalidChannelDescriptor" => "6.4.0", "cuStreamBatchMemOp_v2" => "6.4.0", "cuStreamBatchMemOp" => "6.4.0", "cuGraphExecBatchMemOpNodeSetParams" => "6.4.0", "cuGraphBatchMemOpNodeSetParams" => "6.4.0", "cuGraphBatchMemOpNodeGetParams" => "6.4.0", "cuGraphAddBatchMemOpNode" => "6.4.0", + "cuEventRecordWithFlags" => "6.4.0", + "CUstreamBatchMemOpType_enum" => "6.4.0", + "CUstreamBatchMemOpType" => "6.4.0", "CUstreamBatchMemOpParams_v1" => "6.4.0", "CUstreamBatchMemOpParams_union" => "6.4.0", "CUstreamBatchMemOpParams" => "6.4.0", + "CU_STREAM_MEM_OP_WRITE_VALUE_64" => "6.4.0", + "CU_STREAM_MEM_OP_WRITE_VALUE_32" => "6.4.0", + "CU_STREAM_MEM_OP_WAIT_VALUE_64" => "6.4.0", + "CU_STREAM_MEM_OP_WAIT_VALUE_32" => "6.4.0", + "CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES" => "6.4.0", + "CU_STREAM_MEM_OP_BARRIER" => "6.4.0", + "CU_GRAPH_NODE_TYPE_BATCH_MEM_OP" => "6.4.0", "CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st" => "6.4.0", "CUDA_BATCH_MEM_OP_NODE_PARAMS_v2" => "6.4.0", "CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st" => "6.4.0", @@ -1550,6 +1563,8 @@ sub subst { } sub experimentalSubstitutions { + subst("cuEventRecordWithFlags", "hipEventRecordWithFlags", "event"); + subst("cudaEventRecordWithFlags", "hipEventRecordWithFlags", "event"); subst("cuStreamBatchMemOp", "hipStreamBatchMemOp", "stream_memory"); subst("cuStreamBatchMemOp_v2", "hipStreamBatchMemOp", "stream_memory"); subst("cuGraphAddBatchMemOpNode", "hipGraphAddBatchMemOpNode", "graph"); @@ -1565,6 +1580,17 @@ sub experimentalSubstitutions { subst("CUstreamBatchMemOpParams", "hipStreamBatchMemOpParams", "type"); subst("CUstreamBatchMemOpParams_union", "hipStreamBatchMemOpParams_union", "type"); subst("CUstreamBatchMemOpParams_v1", "hipStreamBatchMemOpParams", "type"); + subst("CUstreamBatchMemOpType", "hipStreamBatchMemOpType", "type"); + subst("CUstreamBatchMemOpType_enum", "hipStreamBatchMemOpType", "type"); + subst("CU_GRAPH_NODE_TYPE_BATCH_MEM_OP", "hipGraphNodeTypeBatchMemOp", "numeric_literal"); + subst("CU_STREAM_MEM_OP_BARRIER", "hipStreamMemOpBarrier", "numeric_literal"); + subst("CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES", "hipStreamMemOpFlushRemoteWrites", "numeric_literal"); + subst("CU_STREAM_MEM_OP_WAIT_VALUE_32", "hipStreamMemOpWaitValue32", "numeric_literal"); + subst("CU_STREAM_MEM_OP_WAIT_VALUE_64", "hipStreamMemOpWaitValue64", "numeric_literal"); + subst("CU_STREAM_MEM_OP_WRITE_VALUE_32", "hipStreamMemOpWriteValue32", "numeric_literal"); + subst("CU_STREAM_MEM_OP_WRITE_VALUE_64", "hipStreamMemOpWriteValue64", "numeric_literal"); + subst("cudaErrorInvalidChannelDescriptor", "hipErrorInvalidChannelDescriptor", "numeric_literal"); + subst("cudaErrorInvalidTexture", "hipErrorInvalidTexture", "numeric_literal"); } sub rocSubstitutions { diff --git a/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md b/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md index 2b948d6c..6a58880c 100644 --- a/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md +++ b/docs/tables/CUDA_Driver_API_functions_supported_by_HIP.md @@ -725,7 +725,7 @@ |`CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`|11.4| | | |`hipGraphMemAttrReservedMemHigh`|5.3.0| | | | | |`CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT`|11.4| | | |`hipGraphMemAttrUsedMemCurrent`|5.3.0| | | | | |`CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`|11.4| | | |`hipGraphMemAttrUsedMemHigh`|5.3.0| | | | | -|`CU_GRAPH_NODE_TYPE_BATCH_MEM_OP`|11.7| | | | | | | | | | +|`CU_GRAPH_NODE_TYPE_BATCH_MEM_OP`|11.7| | | |`hipGraphNodeTypeBatchMemOp`|6.4.0| | | |6.4.0| |`CU_GRAPH_NODE_TYPE_CONDITIONAL`|12.3| | | | | | | | | | |`CU_GRAPH_NODE_TYPE_COUNT`|10.0| | |11.0|`hipGraphNodeTypeCount`|4.3.0| | | | | |`CU_GRAPH_NODE_TYPE_EMPTY`|10.0| | | |`hipGraphNodeTypeEmpty`|4.3.0| | | | | @@ -991,12 +991,12 @@ |`CU_STREAM_LEGACY`| | | | |`hipStreamLegacy`|6.2.0| | | | | |`CU_STREAM_MEMORY_BARRIER_TYPE_GPU`|11.7| | | | | | | | | | |`CU_STREAM_MEMORY_BARRIER_TYPE_SYS`|11.7| | | | | | | | | | -|`CU_STREAM_MEM_OP_BARRIER`|11.7| | | | | | | | | | -|`CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`|8.0| | | | | | | | | | -|`CU_STREAM_MEM_OP_WAIT_VALUE_32`|8.0| | | | | | | | | | -|`CU_STREAM_MEM_OP_WAIT_VALUE_64`|9.0| | | | | | | | | | -|`CU_STREAM_MEM_OP_WRITE_VALUE_32`|8.0| | | | | | | | | | -|`CU_STREAM_MEM_OP_WRITE_VALUE_64`|9.0| | | | | | | | | | +|`CU_STREAM_MEM_OP_BARRIER`|11.7| | | |`hipStreamMemOpBarrier`|6.4.0| | | |6.4.0| +|`CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`|8.0| | | |`hipStreamMemOpFlushRemoteWrites`|6.4.0| | | |6.4.0| +|`CU_STREAM_MEM_OP_WAIT_VALUE_32`|8.0| | | |`hipStreamMemOpWaitValue32`|6.4.0| | | |6.4.0| +|`CU_STREAM_MEM_OP_WAIT_VALUE_64`|9.0| | | |`hipStreamMemOpWaitValue64`|6.4.0| | | |6.4.0| +|`CU_STREAM_MEM_OP_WRITE_VALUE_32`|8.0| | | |`hipStreamMemOpWriteValue32`|6.4.0| | | |6.4.0| +|`CU_STREAM_MEM_OP_WRITE_VALUE_64`|9.0| | | |`hipStreamMemOpWriteValue64`|6.4.0| | | |6.4.0| |`CU_STREAM_NON_BLOCKING`| | | | |`hipStreamNonBlocking`|1.6.0| | | | | |`CU_STREAM_PER_THREAD`| | | | |`hipStreamPerThread`|4.5.0| | | | | |`CU_STREAM_SET_CAPTURE_DEPENDENCIES`|11.3| | | |`hipStreamSetCaptureDependencies`|5.0.0| | | | | @@ -1378,8 +1378,8 @@ |`CUstreamBatchMemOpParams`|8.0| | | |`hipStreamBatchMemOpParams`|6.4.0| | | |6.4.0| |`CUstreamBatchMemOpParams_union`|8.0| | | |`hipStreamBatchMemOpParams_union`|6.4.0| | | |6.4.0| |`CUstreamBatchMemOpParams_v1`|11.3| | | |`hipStreamBatchMemOpParams`|6.4.0| | | |6.4.0| -|`CUstreamBatchMemOpType`|8.0| | | | | | | | | | -|`CUstreamBatchMemOpType_enum`|8.0| | | | | | | | | | +|`CUstreamBatchMemOpType`|8.0| | | |`hipStreamBatchMemOpType`|6.4.0| | | |6.4.0| +|`CUstreamBatchMemOpType_enum`|8.0| | | |`hipStreamBatchMemOpType`|6.4.0| | | |6.4.0| |`CUstreamCallback`| | | | |`hipStreamCallback_t`|1.6.0| | | | | |`CUstreamCaptureMode`|10.1| | | |`hipStreamCaptureMode`|4.3.0| | | | | |`CUstreamCaptureMode_enum`|10.1| | | |`hipStreamCaptureMode`|4.3.0| | | | | @@ -1817,7 +1817,7 @@ |`cuEventElapsedTime`| | | | |`hipEventElapsedTime`|1.6.0| | | | | |`cuEventQuery`| | | | |`hipEventQuery`|1.6.0| | | | | |`cuEventRecord`| | | | |`hipEventRecord`|1.6.0| | | | | -|`cuEventRecordWithFlags`|11.1| | | | | | | | | | +|`cuEventRecordWithFlags`|11.1| | | |`hipEventRecordWithFlags`|6.4.0| | | |6.4.0| |`cuEventSynchronize`| | | | |`hipEventSynchronize`|1.6.0| | | | | ## **20. External Resource Interoperability** diff --git a/docs/tables/CUDA_Runtime_API_functions_supported_by_HIP.md b/docs/tables/CUDA_Runtime_API_functions_supported_by_HIP.md index 6eba24f0..4ccadf3f 100644 --- a/docs/tables/CUDA_Runtime_API_functions_supported_by_HIP.md +++ b/docs/tables/CUDA_Runtime_API_functions_supported_by_HIP.md @@ -103,7 +103,7 @@ |`cudaEventElapsedTime`| | | | |`hipEventElapsedTime`|1.6.0| | | | | |`cudaEventQuery`| | | | |`hipEventQuery`|1.6.0| | | | | |`cudaEventRecord`| | | | |`hipEventRecord`|1.6.0| | | | | -|`cudaEventRecordWithFlags`|11.1| | | | | | | | | | +|`cudaEventRecordWithFlags`|11.1| | | |`hipEventRecordWithFlags`|6.4.0| | | |6.4.0| |`cudaEventSynchronize`| | | | |`hipEventSynchronize`|1.6.0| | | | | ## **7. External Resource Interoperability** @@ -1045,7 +1045,7 @@ |`cudaErrorInitializationError`| | | | |`hipErrorNotInitialized`|1.6.0| | | | | |`cudaErrorInsufficientDriver`| | | | |`hipErrorInsufficientDriver`|1.7.0| | | | | |`cudaErrorInvalidAddressSpace`| | | | | | | | | | | -|`cudaErrorInvalidChannelDescriptor`| | | | | | | | | | | +|`cudaErrorInvalidChannelDescriptor`| | | | |`hipErrorInvalidChannelDescriptor`|6.4.0| | | |6.4.0| |`cudaErrorInvalidClusterSize`|11.8| | | | | | | | | | |`cudaErrorInvalidConfiguration`| | | | |`hipErrorInvalidConfiguration`|1.6.0| | | | | |`cudaErrorInvalidDevice`| | | | |`hipErrorInvalidDevice`|1.6.0| | | | | @@ -1066,7 +1066,7 @@ |`cudaErrorInvalidSource`|10.1| | | |`hipErrorInvalidSource`|1.6.0| | | | | |`cudaErrorInvalidSurface`| | | | | | | | | | | |`cudaErrorInvalidSymbol`| | | | |`hipErrorInvalidSymbol`|1.6.0| | | | | -|`cudaErrorInvalidTexture`| | | | | | | | | | | +|`cudaErrorInvalidTexture`| | | | |`hipErrorInvalidTexture`|6.4.0| | | |6.4.0| |`cudaErrorInvalidTextureBinding`| | | | | | | | | | | |`cudaErrorInvalidValue`| | | | |`hipErrorInvalidValue`|1.6.0| | | | | |`cudaErrorJitCompilationDisabled`|11.2| | | | | | | | | | diff --git a/src/CUDA2HIP_Driver_API_functions.cpp b/src/CUDA2HIP_Driver_API_functions.cpp index 1d4b9819..4f09c001 100644 --- a/src/CUDA2HIP_Driver_API_functions.cpp +++ b/src/CUDA2HIP_Driver_API_functions.cpp @@ -534,7 +534,7 @@ const std::map CUDA_DRIVER_FUNCTION_MAP { // cudaEventSynchronize {"cuEventSynchronize", {"hipEventSynchronize", "", CONV_EVENT, API_DRIVER, SEC::EVENT}}, // cudaEventRecordWithFlags - {"cuEventRecordWithFlags", {"hipEventRecordWithFlags", "", CONV_EVENT, API_DRIVER, SEC::EVENT, HIP_UNSUPPORTED}}, + {"cuEventRecordWithFlags", {"hipEventRecordWithFlags", "", CONV_EVENT, API_DRIVER, SEC::EVENT, HIP_EXPERIMENTAL}}, // 20. External Resource Interoperability // cudaDestroyExternalMemory @@ -1670,6 +1670,7 @@ const std::map HIP_DRIVER_FUNCTION_VER_MAP { {"hipGraphBatchMemOpNodeGetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, {"hipGraphBatchMemOpNodeSetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, {"hipGraphExecBatchMemOpNodeSetParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipEventRecordWithFlags", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, }; const std::map CUDA_DRIVER_FUNCTION_CHANGED_VER_MAP { diff --git a/src/CUDA2HIP_Driver_API_types.cpp b/src/CUDA2HIP_Driver_API_types.cpp index 1d77e091..4fb6d8e3 100644 --- a/src/CUDA2HIP_Driver_API_types.cpp +++ b/src/CUDA2HIP_Driver_API_types.cpp @@ -1326,7 +1326,7 @@ const std::map CUDA_DRIVER_TYPE_NAME_MAP { // cudaGraphNodeTypeMemFree {"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 + {"CU_GRAPH_NODE_TYPE_BATCH_MEM_OP", {"hipGraphNodeTypeBatchMemOp", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 12 // cudaGraphNodeTypeConditional {"CU_GRAPH_NODE_TYPE_CONDITIONAL", {"hipGraphNodeTypeConditional", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 13 // cudaGraphNodeTypeCount @@ -1914,15 +1914,15 @@ const std::map CUDA_DRIVER_TYPE_NAME_MAP { {"CU_STREAM_NON_BLOCKING", {"hipStreamNonBlocking", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES}}, // 0x1 // no analogue - {"CUstreamBatchMemOpType", {"hipStreamBatchMemOpType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, - {"CUstreamBatchMemOpType_enum", {"hipStreamBatchMemOpType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, + {"CUstreamBatchMemOpType", {"hipStreamBatchMemOpType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, + {"CUstreamBatchMemOpType_enum", {"hipStreamBatchMemOpType", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // CUstreamBatchMemOpType enum values - {"CU_STREAM_MEM_OP_WAIT_VALUE_32", {"hipStreamBatchMemOpWaitValue32", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 1 - {"CU_STREAM_MEM_OP_WRITE_VALUE_32", {"hipStreamBatchMemOpWriteValue32", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 2 - {"CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES", {"hipStreamBatchMemOpFlushRemoteWrites", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 3 - {"CU_STREAM_MEM_OP_WAIT_VALUE_64", {"hipStreamBatchMemOpWaitValue64", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 4 - {"CU_STREAM_MEM_OP_WRITE_VALUE_64", {"hipStreamBatchMemOpWriteValue64", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 5 - {"CU_STREAM_MEM_OP_BARRIER", {"hipStreamBatchMemOpBarrier", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 6 + {"CU_STREAM_MEM_OP_WAIT_VALUE_32", {"hipStreamMemOpWaitValue32", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 1 + {"CU_STREAM_MEM_OP_WRITE_VALUE_32", {"hipStreamMemOpWriteValue32", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 2 + {"CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES", {"hipStreamMemOpFlushRemoteWrites", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 3 + {"CU_STREAM_MEM_OP_WAIT_VALUE_64", {"hipStreamMemOpWaitValue64", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 4 + {"CU_STREAM_MEM_OP_WRITE_VALUE_64", {"hipStreamMemOpWriteValue64", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 5 + {"CU_STREAM_MEM_OP_BARRIER", {"hipStreamMemOpBarrier", "", CONV_NUMERIC_LITERAL, API_DRIVER, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 6 // cudaStreamCaptureStatus {"CUstreamCaptureStatus", {"hipStreamCaptureStatus", "", CONV_TYPE, API_DRIVER, SEC::DATA_TYPES}}, @@ -4307,4 +4307,12 @@ const std::map HIP_DRIVER_TYPE_NAME_VER_MAP { {"hipStreamBatchMemOpParams_union", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, {"hipStreamBatchMemOpParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, {"hipBatchMemOpNodeParams", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamBatchMemOpType", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpWaitValue32", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpWriteValue32", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpFlushRemoteWrites", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpWaitValue64", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpWriteValue64", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipStreamMemOpBarrier", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipGraphNodeTypeBatchMemOp", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, }; diff --git a/src/CUDA2HIP_Runtime_API_functions.cpp b/src/CUDA2HIP_Runtime_API_functions.cpp index 256b5ab5..6550e309 100644 --- a/src/CUDA2HIP_Runtime_API_functions.cpp +++ b/src/CUDA2HIP_Runtime_API_functions.cpp @@ -194,7 +194,7 @@ const std::map CUDA_RUNTIME_FUNCTION_MAP { // cuEventSynchronize {"cudaEventSynchronize", {"hipEventSynchronize", "", CONV_EVENT, API_RUNTIME, SEC::EVENT}}, // cuEventRecordWithFlags - {"cudaEventRecordWithFlags", {"hipEventRecordWithFlags", "", CONV_EVENT, API_RUNTIME, SEC::EVENT, HIP_UNSUPPORTED}}, + {"cudaEventRecordWithFlags", {"hipEventRecordWithFlags", "", CONV_EVENT, API_RUNTIME, SEC::EVENT, HIP_EXPERIMENTAL}}, // 7. External Resource Interoperability // cuDestroyExternalMemory diff --git a/src/CUDA2HIP_Runtime_API_types.cpp b/src/CUDA2HIP_Runtime_API_types.cpp index dc0aebc6..bf2c801f 100644 --- a/src/CUDA2HIP_Runtime_API_types.cpp +++ b/src/CUDA2HIP_Runtime_API_types.cpp @@ -886,11 +886,11 @@ const std::map CUDA_RUNTIME_TYPE_NAME_MAP { // no analogue {"cudaErrorInvalidDevicePointer", {"hipErrorInvalidDevicePointer", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, CUDA_DEPRECATED}}, // 17 // no analogue - {"cudaErrorInvalidTexture", {"hipErrorInvalidTexture", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 18 + {"cudaErrorInvalidTexture", {"hipErrorInvalidTexture", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 18 // no analogue {"cudaErrorInvalidTextureBinding", {"hipErrorInvalidTextureBinding", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 19 // no analogue - {"cudaErrorInvalidChannelDescriptor", {"hipErrorInvalidChannelDescriptor", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, HIP_UNSUPPORTED}}, // 20 + {"cudaErrorInvalidChannelDescriptor", {"hipErrorInvalidChannelDescriptor", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES, HIP_EXPERIMENTAL}}, // 20 // no analogue {"cudaErrorInvalidMemcpyDirection", {"hipErrorInvalidMemcpyDirection", "", CONV_NUMERIC_LITERAL, API_RUNTIME, SEC::DATA_TYPES}}, // 21 // Deprecated since CUDA 3.1 @@ -3202,4 +3202,6 @@ const std::map HIP_RUNTIME_TYPE_NAME_VER_MAP { {"HIP_TWO_TO_M1022", {HIP_5070, HIP_0, HIP_0 }}, {"HIP_TRIG_PLOSS", {HIP_5070, HIP_0, HIP_0 }}, {"HIP_DBL2INT_CVT", {HIP_5070, HIP_0, HIP_0 }}, + {"hipErrorInvalidChannelDescriptor", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, + {"hipErrorInvalidTexture", {HIP_6040, HIP_0, HIP_0, HIP_LATEST}}, }; diff --git a/tests/unit_tests/synthetic/driver_enums.cu b/tests/unit_tests/synthetic/driver_enums.cu index 7ef80ee6..f243d46e 100644 --- a/tests/unit_tests/synthetic/driver_enums.cu +++ b/tests/unit_tests/synthetic/driver_enums.cu @@ -687,6 +687,17 @@ int main() { int STREAM_WAIT_VALUE_GEQ = CU_STREAM_WAIT_VALUE_GEQ; int STREAM_WAIT_VALUE_EQ = CU_STREAM_WAIT_VALUE_EQ; int STREAM_WAIT_VALUE_AND = CU_STREAM_WAIT_VALUE_AND; + + // CHECK: hipStreamBatchMemOpType streamBatchMemOpType; + // CHECK-NEXT: hipStreamBatchMemOpType streamBatchMemOpType_enum; + // CHECK-NEXT: hipStreamBatchMemOpType STREAM_MEM_OP_WAIT_VALUE_32 = hipStreamMemOpWaitValue32; + // CHECK-NEXT: hipStreamBatchMemOpType STREAM_MEM_OP_WRITE_VALUE_32 = hipStreamMemOpWriteValue32; + // CHECK-NEXT: hipStreamBatchMemOpType STREAM_MEM_OP_FLUSH_REMOTE_WRITES = hipStreamMemOpFlushRemoteWrites; + CUstreamBatchMemOpType streamBatchMemOpType; + CUstreamBatchMemOpType_enum streamBatchMemOpType_enum; + CUstreamBatchMemOpType STREAM_MEM_OP_WAIT_VALUE_32 = CU_STREAM_MEM_OP_WAIT_VALUE_32; + CUstreamBatchMemOpType STREAM_MEM_OP_WRITE_VALUE_32 = CU_STREAM_MEM_OP_WRITE_VALUE_32; + CUstreamBatchMemOpType STREAM_MEM_OP_FLUSH_REMOTE_WRITES = CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES; #endif #if CUDA_VERSION >= 9000 @@ -707,6 +718,11 @@ int main() { // CHECK: int STREAM_WAIT_VALUE_NOR = hipStreamWaitValueNor; int STREAM_WAIT_VALUE_NOR = CU_STREAM_WAIT_VALUE_NOR; + + // CHECK: hipStreamBatchMemOpType STREAM_MEM_OP_WAIT_VALUE_64 = hipStreamMemOpWaitValue64; + // CHECK-NEXT: hipStreamBatchMemOpType STREAM_MEM_OP_WRITE_VALUE_64 = hipStreamMemOpWriteValue64; + CUstreamBatchMemOpType STREAM_MEM_OP_WAIT_VALUE_64 = CU_STREAM_MEM_OP_WAIT_VALUE_64; + CUstreamBatchMemOpType STREAM_MEM_OP_WRITE_VALUE_64 = CU_STREAM_MEM_OP_WRITE_VALUE_64; #endif #if CUDA_VERSION >= 9000 && CUDA_VERSION < 12000 @@ -1125,6 +1141,12 @@ int main() { // CHECK: hipKernelNodeAttrID KernelNodeAttributePriority = hipKernelNodeAttributePriority; CUkernelNodeAttrID KernelNodeAttributePriority = CU_KERNEL_NODE_ATTRIBUTE_PRIORITY; + + // CHECK: hipGraphNodeType GRAPH_NODE_TYPE_BATCH_MEM_OP = hipGraphNodeTypeBatchMemOp; + CUgraphNodeType GRAPH_NODE_TYPE_BATCH_MEM_OP = CU_GRAPH_NODE_TYPE_BATCH_MEM_OP; + + // CHECK: hipStreamBatchMemOpType STREAM_MEM_OP_BARRIER = hipStreamMemOpBarrier; + CUstreamBatchMemOpType STREAM_MEM_OP_BARRIER = CU_STREAM_MEM_OP_BARRIER; #endif #if CUDA_VERSION >= 11080 diff --git a/tests/unit_tests/synthetic/driver_functions.cu b/tests/unit_tests/synthetic/driver_functions.cu index ec8fa722..af597ca9 100644 --- a/tests/unit_tests/synthetic/driver_functions.cu +++ b/tests/unit_tests/synthetic/driver_functions.cu @@ -1595,6 +1595,11 @@ int main() { // HIP: hipError_t hipGraphUpload(hipGraphExec_t graphExec, hipStream_t stream); // CHECK: result = hipGraphUpload(graphExec, stream); result = cuGraphUpload(graphExec, stream); + + // CUDA:CUresult CUDAAPI cuEventRecordWithFlags(CUevent hEvent, CUstream hStream, unsigned int flags); + // HIP: hipError_t hipEventRecordWithFlags(hipEvent_t event, hipStream_t stream __dparm(0), unsigned int flags __dparm(0)); + // CHECK: result = hipEventRecordWithFlags(event_, stream, flags); + result = cuEventRecordWithFlags(event_, stream, flags); #endif #if CUDA_VERSION >= 11020 @@ -1881,6 +1886,9 @@ int main() { // CHECK: hipBatchMemOpNodeParams BATCH_MEM_OP_NODE_PARAMS; CUDA_BATCH_MEM_OP_NODE_PARAMS BATCH_MEM_OP_NODE_PARAMS; + // CHECK: hipGraphNodeType GRAPH_NODE_TYPE_BATCH_MEM_OP = hipGraphNodeTypeBatchMemOp; + CUgraphNodeType GRAPH_NODE_TYPE_BATCH_MEM_OP = CU_GRAPH_NODE_TYPE_BATCH_MEM_OP; + // CUDA: CUresult CUDAAPI cuGraphAddBatchMemOpNode(CUgraphNode *phGraphNode, CUgraph hGraph, const CUgraphNode *dependencies, size_t numDependencies, const CUDA_BATCH_MEM_OP_NODE_PARAMS *nodeParams); // HIP: hipError_t hipGraphAddBatchMemOpNode(hipGraphNode_t *phGraphNode, hipGraph_t hGraph, const hipGraphNode_t* dependencies, size_t numDependencies, const hipBatchMemOpNodeParams* nodeParams); // CHECK: result = hipGraphAddBatchMemOpNode(&graphNode, graph, &graphNode2, bytes, &BATCH_MEM_OP_NODE_PARAMS); diff --git a/tests/unit_tests/synthetic/runtime_enums.cu b/tests/unit_tests/synthetic/runtime_enums.cu index 9b0ff8a3..e6ae3cae 100644 --- a/tests/unit_tests/synthetic/runtime_enums.cu +++ b/tests/unit_tests/synthetic/runtime_enums.cu @@ -240,6 +240,8 @@ int main() { // CHECK-NEXT: hipError_t ErrorHostMemoryNotRegistered = hipErrorHostMemoryNotRegistered; // CHECK-NEXT: hipError_t ErrorLaunchFailure = hipErrorLaunchFailure; // CHECK-NEXT: hipError_t ErrorNotSupported = hipErrorNotSupported; + // CHECK-NEXT: hipError_t ErrorInvalidTexture = hipErrorInvalidTexture; + // CHECK-NEXT: hipError_t ErrorInvalidChannelDescriptor = hipErrorInvalidChannelDescriptor; cudaError Error; cudaError_t Error_t; cudaError_t Success = cudaSuccess; @@ -288,6 +290,8 @@ int main() { cudaError_t ErrorHostMemoryNotRegistered = cudaErrorHostMemoryNotRegistered; cudaError_t ErrorLaunchFailure = cudaErrorLaunchFailure; cudaError_t ErrorNotSupported = cudaErrorNotSupported; + cudaError_t ErrorInvalidTexture = cudaErrorInvalidTexture; + cudaError_t ErrorInvalidChannelDescriptor = cudaErrorInvalidChannelDescriptor; // CHECK: hipError_t ErrorUnknown = hipErrorUnknown; cudaError_t ErrorUnknown = cudaErrorUnknown; diff --git a/tests/unit_tests/synthetic/runtime_functions.cu b/tests/unit_tests/synthetic/runtime_functions.cu index f9c92a39..6e066522 100644 --- a/tests/unit_tests/synthetic/runtime_functions.cu +++ b/tests/unit_tests/synthetic/runtime_functions.cu @@ -1316,6 +1316,11 @@ int main() { // HIP: hipError_t hipGraphUpload(hipGraphExec_t graphExec, hipStream_t stream); // CHECK: result = hipGraphUpload(GraphExec_t, stream); result = cudaGraphUpload(GraphExec_t, stream); + + // CUDA:extern __host__ __cudart_builtin__ cudaError_t CUDARTAPI cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream __dv(0), unsigned int flags __dv(0)); + // HIP: hipError_t hipEventRecordWithFlags(hipEvent_t event, hipStream_t stream __dparm(0), unsigned int flags __dparm(0)); + // CHECK: result = hipEventRecordWithFlags(Event_t, stream, flags); + result = cudaEventRecordWithFlags(Event_t, stream, flags); #endif #if CUDA_VERSION >= 11020