Skip to content

Commit

Permalink
[HIPIFY][TensorMg][feature] cuTensorMg support - Part 3
Browse files Browse the repository at this point in the history
+ Updated the regenerated `hipify-perl` and `TENSOR` `CUDA2HIP` docs accordingly
  • Loading branch information
emankov committed Dec 25, 2024
1 parent d54303f commit 0eeb128
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -9939,12 +9939,20 @@ sub warnHipOnlyUnsupportedFunctions {
"cutensorMgHostDevice_t",
"cutensorMgHandle_t",
"cutensorMgHandle_s",
"cutensorMgDestroy",
"cutensorMgCreate",
"cutensorMgCopyPlan_t",
"cutensorMgCopyPlan_s",
"cutensorMgCopyDescriptor_t",
"cutensorMgCopyDescriptor_s",
"cutensorMgContractionPlan_t",
"cutensorMgContractionPlan_s",
"cutensorMgContractionFind_t",
"cutensorMgContractionFind_s",
"cutensorMgContractionFindAttribute_t",
"cutensorMgContractionDescriptor_t",
"cutensorMgContractionDescriptor_s",
"cutensorMgAlgo_t",
"cutensorJitMode_t",
"cutensorHandleWritePlanCacheToFile",
"cutensorHandleResizePlanCache",
Expand Down Expand Up @@ -10366,6 +10374,8 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_ALGO_TTGT",
"CUTENSOR_ALGO_TGETT",
"CUTENSOR_ALGO_GETT",
"CUTENSORMG_CONTRACTION_FIND_ATTRIBUTE_MAX",
"CUTENSORMG_ALGO_DEFAULT",
"CUSPARSE_SPSV_UPDATE_GENERAL",
"CUSPARSE_SPSV_UPDATE_DIAGONAL",
"CUSPARSE_SPSM_UPDATE_GENERAL",
Expand Down Expand Up @@ -11317,12 +11327,20 @@ sub warnRocOnlyUnsupportedFunctions {
"cutensorMgHostDevice_t",
"cutensorMgHandle_t",
"cutensorMgHandle_s",
"cutensorMgDestroy",
"cutensorMgCreate",
"cutensorMgCopyPlan_t",
"cutensorMgCopyPlan_s",
"cutensorMgCopyDescriptor_t",
"cutensorMgCopyDescriptor_s",
"cutensorMgContractionPlan_t",
"cutensorMgContractionPlan_s",
"cutensorMgContractionFind_t",
"cutensorMgContractionFind_s",
"cutensorMgContractionFindAttribute_t",
"cutensorMgContractionDescriptor_t",
"cutensorMgContractionDescriptor_s",
"cutensorMgAlgo_t",
"cutensorJitMode_t",
"cutensorHandleWritePlanCacheToFile",
"cutensorHandleResizePlanCache",
Expand Down Expand Up @@ -11834,6 +11852,8 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_ALGO_TTGT",
"CUTENSOR_ALGO_TGETT",
"CUTENSOR_ALGO_GETT",
"CUTENSORMG_CONTRACTION_FIND_ATTRIBUTE_MAX",
"CUTENSORMG_ALGO_DEFAULT",
"CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED",
"CUSPARSE_STATUS_MAPPING_ERROR",
"CUSPARSE_STATUS_INSUFFICIENT_RESOURCES",
Expand Down
10 changes: 10 additions & 0 deletions docs/tables/CUTENSOR_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

|**CUDA**|**A**|**D**|**C**|**R**|**HIP**|**A**|**D**|**C**|**R**|**E**|
|:--|:-:|:-:|:-:|:-:|:--|:-:|:-:|:-:|:-:|:-:|
|`CUTENSORMG_ALGO_DEFAULT`|1.4.0.0| | | | | | | | | |
|`CUTENSORMG_CONTRACTION_FIND_ATTRIBUTE_MAX`|1.5.0.0| | | | | | | | | |
|`CUTENSOR_ALGO_DEFAULT`|1.0.1.0| | | |`HIPTENSOR_ALGO_DEFAULT`|5.7.0| | | | |
|`CUTENSOR_ALGO_DEFAULT_PATIENT`|1.4.0.0| | | |`HIPTENSOR_ALGO_DEFAULT_PATIENT`|5.7.0| | | | |
|`CUTENSOR_ALGO_GETT`|1.0.1.0| | | | | | | | | |
Expand Down Expand Up @@ -144,8 +146,14 @@
|`cutensorHandle_t`|1.0.1.0| | | |`hiptensorHandle_t`|5.7.0| | | | |
|`cutensorJitMode_t`|2.0.0.0| | | | | | | | | |
|`cutensorLoggerCallback_t`|1.3.2.0| | | |`hiptensorLoggerCallback_t`|5.7.0| | | | |
|`cutensorMgAlgo_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionDescriptor_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionDescriptor_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionFindAttribute_t`|1.5.0.0| | | | | | | | | |
|`cutensorMgContractionFind_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionFind_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionPlan_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionPlan_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyDescriptor_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyDescriptor_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyPlan_s`|1.4.0.0| | | | | | | | | |
Expand Down Expand Up @@ -202,6 +210,8 @@
|`cutensorLoggerSetFile`|1.3.2.0| | | |`hiptensorLoggerSetFile`|5.7.0| | | | |
|`cutensorLoggerSetLevel`|1.3.2.0| | | |`hiptensorLoggerSetLevel`|5.7.0| | | | |
|`cutensorLoggerSetMask`|1.3.2.0| | | |`hiptensorLoggerSetMask`|5.7.0| | | | |
|`cutensorMgCreate`|1.4.0.0| | | | | | | | | |
|`cutensorMgDestroy`|1.4.0.0| | | | | | | | | |
|`cutensorOperationDescriptorGetAttribute`|2.0.0.0| | | | | | | | | |
|`cutensorOperationDescriptorSetAttribute`|2.0.0.0| | | | | | | | | |
|`cutensorPermutation`|1.0.1.0| | |2.0.0.0|`hiptensorPermutation`|6.1.0| | | | |
Expand Down
4 changes: 4 additions & 0 deletions src/CUDA2HIP_TENSOR_API_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_FUNCTION_MAP {
{"cutensorLoggerSetLevel", {"hiptensorLoggerSetLevel", "", CONV_LIB_FUNC, API_TENSOR, 2}},
{"cutensorLoggerSetMask", {"hiptensorLoggerSetMask", "", CONV_LIB_FUNC, API_TENSOR, 2}},
{"cutensorLoggerForceDisable", {"hiptensorLoggerForceDisable", "", CONV_LIB_FUNC, API_TENSOR, 2}},
{"cutensorMgCreate", {"", "", CONV_LIB_FUNC, API_TENSOR, 2, UNSUPPORTED}},
{"cutensorMgDestroy", {"", "", CONV_LIB_FUNC, API_TENSOR, 2, UNSUPPORTED}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_FUNCTION_VER_MAP {
Expand Down Expand Up @@ -110,6 +112,8 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_FUNCTION_VER_MAP {
{"cutensorLoggerSetLevel", {CUTENSOR_1320, CUDA_0, CUDA_0 }},
{"cutensorLoggerSetMask", {CUTENSOR_1320, CUDA_0, CUDA_0 }},
{"cutensorLoggerForceDisable", {CUTENSOR_1320, CUDA_0, CUDA_0 }},
{"cutensorMgCreate", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgDestroy", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_TENSOR_FUNCTION_VER_MAP {
Expand Down
18 changes: 18 additions & 0 deletions src/CUDA2HIP_TENSOR_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_TYPE_NAME_MAP {
{"CUTENSOR_MG_DEVICE_HOST", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_MG_DEVICE_HOST_PINNED", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},

{"cutensorMgAlgo_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSORMG_ALGO_DEFAULT", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},

{"cutensorMgContractionFindAttribute_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSORMG_CONTRACTION_FIND_ATTRIBUTE_MAX", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},

{"cutensorHandle_t", {"hiptensorHandle_t", "", CONV_TYPE, API_TENSOR, 1}},
{"cutensorHandle", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorTensorDescriptor_t", {"hiptensorTensorDescriptor_t", "", CONV_TYPE, API_TENSOR, 1}},
Expand All @@ -199,6 +205,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_TYPE_NAME_MAP {
{"cutensorMgCopyPlan_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionDescriptor_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionDescriptor_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionFind_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionFind_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionPlan_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionPlan_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_TYPE_NAME_VER_MAP {
Expand Down Expand Up @@ -364,6 +374,14 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_TYPE_NAME_VER_MAP {
{"cutensorMgCopyPlan_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionDescriptor_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionDescriptor_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionFind_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionFind_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionPlan_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionPlan_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgAlgo_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"CUTENSORMG_ALGO_DEFAULT", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionFindAttribute_t", {CUTENSOR_1500, CUDA_0, CUDA_0 }},
{"CUTENSORMG_CONTRACTION_FIND_ATTRIBUTE_MAX", {CUTENSOR_1500, CUDA_0, CUDA_0 }},
};

const std::map<llvm::StringRef, hipAPIversions> HIP_TENSOR_TYPE_NAME_VER_MAP {
Expand Down

0 comments on commit 0eeb128

Please sign in to comment.