Skip to content

Commit

Permalink
Merge pull request #1810 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][TensorMg][feature] `cuTensorMg` support - Part 2
  • Loading branch information
emankov authored Dec 24, 2024
2 parents a19ac36 + ce62952 commit d54303f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -9934,6 +9934,17 @@ sub warnHipOnlyUnsupportedFunctions {
"cutensorOperationDescriptorSetAttribute",
"cutensorOperationDescriptorGetAttribute",
"cutensorOperationDescriptorAttribute_t",
"cutensorMgTensorDescriptor_t",
"cutensorMgTensorDescriptor_s",
"cutensorMgHostDevice_t",
"cutensorMgHandle_t",
"cutensorMgHandle_s",
"cutensorMgCopyPlan_t",
"cutensorMgCopyPlan_s",
"cutensorMgCopyDescriptor_t",
"cutensorMgCopyDescriptor_s",
"cutensorMgContractionDescriptor_t",
"cutensorMgContractionDescriptor_s",
"cutensorJitMode_t",
"cutensorHandleWritePlanCacheToFile",
"cutensorHandleResizePlanCache",
Expand Down Expand Up @@ -10326,6 +10337,8 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_LEFT",
"CUTENSOR_OPERATION_DESCRIPTOR_MOVED_BYTES",
"CUTENSOR_OPERATION_DESCRIPTOR_FLOPS",
"CUTENSOR_MG_DEVICE_HOST_PINNED",
"CUTENSOR_MG_DEVICE_HOST",
"CUTENSOR_JIT_MODE_NONE",
"CUTENSOR_JIT_MODE_DEFAULT",
"CUTENSOR_C_MIN_TF32",
Expand Down Expand Up @@ -11299,6 +11312,17 @@ sub warnRocOnlyUnsupportedFunctions {
"cutensorOperationDescriptorSetAttribute",
"cutensorOperationDescriptorGetAttribute",
"cutensorOperationDescriptorAttribute_t",
"cutensorMgTensorDescriptor_t",
"cutensorMgTensorDescriptor_s",
"cutensorMgHostDevice_t",
"cutensorMgHandle_t",
"cutensorMgHandle_s",
"cutensorMgCopyPlan_t",
"cutensorMgCopyPlan_s",
"cutensorMgCopyDescriptor_t",
"cutensorMgCopyDescriptor_s",
"cutensorMgContractionDescriptor_t",
"cutensorMgContractionDescriptor_s",
"cutensorJitMode_t",
"cutensorHandleWritePlanCacheToFile",
"cutensorHandleResizePlanCache",
Expand Down Expand Up @@ -11781,6 +11805,8 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_LEFT",
"CUTENSOR_OPERATION_DESCRIPTOR_MOVED_BYTES",
"CUTENSOR_OPERATION_DESCRIPTOR_FLOPS",
"CUTENSOR_MG_DEVICE_HOST_PINNED",
"CUTENSOR_MG_DEVICE_HOST",
"CUTENSOR_JIT_MODE_NONE",
"CUTENSOR_JIT_MODE_DEFAULT",
"CUTENSOR_C_MIN_TF32",
Expand Down
13 changes: 13 additions & 0 deletions docs/tables/CUTENSOR_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
|`CUTENSOR_C_MIN_TF32`|1.0.1.0|1.2.0.0| |2.0.0.0| | | | | | |
|`CUTENSOR_JIT_MODE_DEFAULT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_JIT_MODE_NONE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_MG_DEVICE_HOST`|1.4.0.0| | | | | | | | | |
|`CUTENSOR_MG_DEVICE_HOST_PINNED`|1.4.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_FLOPS`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_MOVED_BYTES`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_PADDING_LEFT`|2.0.0.0| | | | | | | | | |
Expand Down Expand Up @@ -142,6 +144,17 @@
|`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| | | | |
|`cutensorMgContractionDescriptor_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgContractionDescriptor_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyDescriptor_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyDescriptor_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyPlan_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgCopyPlan_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgHandle_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgHandle_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgHostDevice_t`|1.4.0.0| | | | | | | | | |
|`cutensorMgTensorDescriptor_s`|1.4.0.0| | | | | | | | | |
|`cutensorMgTensorDescriptor_t`|1.4.0.0| | | | | | | | | |
|`cutensorOperationDescriptorAttribute_t`|2.0.0.0| | | | | | | | | |
|`cutensorOperator_t`|1.0.1.0| | | |`hiptensorOperator_t`|5.7.0| | | | |
|`cutensorPlan`|2.0.0.0| | | | | | | | | |
Expand Down
27 changes: 27 additions & 0 deletions src/CUDA2HIP_TENSOR_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_TYPE_NAME_MAP {
{"cutensorPlanAttribute_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_PLAN_REQUIRED_WORKSPACE", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},

{"cutensorMgHostDevice_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_MG_DEVICE_HOST", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_MG_DEVICE_HOST_PINNED", {"", "", 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 @@ -185,6 +189,16 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_TYPE_NAME_MAP {
{"cutensorPlan_t", {"hiptensorContractionPlan_t", "", CONV_TYPE, API_TENSOR, 1}},
{"cutensorPlan", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorLoggerCallback_t", {"hiptensorLoggerCallback_t", "", CONV_TYPE, API_TENSOR, 1}},
{"cutensorMgHandle_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgHandle_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgTensorDescriptor_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgTensorDescriptor_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgCopyDescriptor_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgCopyDescriptor_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgCopyPlan_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgCopyPlan_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionDescriptor_t", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
{"cutensorMgContractionDescriptor_s", {"", "", CONV_TYPE, API_TENSOR, 1, UNSUPPORTED}},
};

const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_TYPE_NAME_VER_MAP {
Expand Down Expand Up @@ -337,6 +351,19 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_TENSOR_TYPE_NAME_VER_MAP {
{"cutensorPlan_t", {CUTENSOR_2000, CUDA_0, CUDA_0 }},
{"cutensorPlan", {CUTENSOR_2000, CUDA_0, CUDA_0 }},
{"cutensorLoggerCallback_t", {CUTENSOR_1320, CUDA_0, CUDA_0 }},
{"cutensorMgHostDevice_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"CUTENSOR_MG_DEVICE_HOST", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"CUTENSOR_MG_DEVICE_HOST_PINNED", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgHandle_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgHandle_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgTensorDescriptor_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgTensorDescriptor_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgCopyDescriptor_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgCopyDescriptor_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgCopyPlan_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgCopyPlan_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionDescriptor_s", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
{"cutensorMgContractionDescriptor_t", {CUTENSOR_1400, CUDA_0, CUDA_0 }},
};

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

0 comments on commit d54303f

Please sign in to comment.