Skip to content

Commit

Permalink
Merge pull request #1777 from aakanksha555/amd-staging
Browse files Browse the repository at this point in the history
[HIPIFY][Tensor][feature] Introduce cuTensor support - Part 6
  • Loading branch information
emankov authored Dec 4, 2024
2 parents 321b470 + 3e681cc commit 62ce2b1
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 0 deletions.
58 changes: 58 additions & 0 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -7341,6 +7341,7 @@ sub simpleSubstitutions {
subst("cutensorDataType_t", "hiptensorComputeType_t", "type");
subst("cutensorOperator_t", "hiptensorOperator_t", "type");
subst("cutensorStatus_t", "hiptensorStatus_t", "type");
subst("cutensorWorksizePreference_t", "hiptensorWorksizePreference_t", "type");
subst("gesvdjInfo_t", "hipsolverGesvdjInfo_t", "type");
subst("nvrtcProgram", "hiprtcProgram", "type");
subst("nvrtcResult", "hiprtcResult", "type");
Expand Down Expand Up @@ -7864,6 +7865,9 @@ sub simpleSubstitutions {
subst("CUTENSOR_STATUS_NOT_INITIALIZED", "HIPTENSOR_STATUS_NOT_INITIALIZED", "numeric_literal");
subst("CUTENSOR_STATUS_NOT_SUPPORTED", "HIPTENSOR_STATUS_NOT_SUPPORTED", "numeric_literal");
subst("CUTENSOR_STATUS_SUCCESS", "HIPTENSOR_STATUS_SUCCESS", "numeric_literal");
subst("CUTENSOR_WORKSPACE_MAX", "HIPTENSOR_WORKSPACE_MAX", "numeric_literal");
subst("CUTENSOR_WORKSPACE_MIN", "HIPTENSOR_WORKSPACE_MIN", "numeric_literal");
subst("CUTENSOR_WORKSPACE_RECOMMENDED", "HIPTENSOR_WORKSPACE_RECOMMENDED", "numeric_literal");
subst("CU_ACCESS_PROPERTY_NORMAL", "hipAccessPropertyNormal", "numeric_literal");
subst("CU_ACCESS_PROPERTY_PERSISTING", "hipAccessPropertyPersisting", "numeric_literal");
subst("CU_ACCESS_PROPERTY_STREAMING", "hipAccessPropertyStreaming", "numeric_literal");
Expand Down Expand Up @@ -12056,6 +12060,12 @@ sub warnHipOnlyUnsupportedFunctions {
my $line_num = shift;
my $k = 0;
foreach $func (
"cutensorPlanPreferenceAttribute_t",
"cutensorPlanAttribute_t",
"cutensorOperationDescriptorAttribute_t",
"cutensorJitMode_t",
"cutensorCacheMode_t",
"cutensorAutotuneMode_t",
"cusparseZhybsv_solve",
"cusparseZhybsv_analysis",
"cusparseZhyb2dense",
Expand Down Expand Up @@ -12627,6 +12637,7 @@ sub warnHipOnlyUnsupportedFunctions {
"csrsv2Info",
"csrsm2Info",
"__curand_umul",
"CUTENSOR_WORKSPACE_DEFAULT",
"CUTENSOR_STATUS_MAPPING_ERROR",
"CUTENSOR_STATUS_LICENSE_ERROR",
"CUTENSOR_STATUS_CUDA_ERROR",
Expand All @@ -12637,6 +12648,13 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_R_4I",
"CUTENSOR_R_16U",
"CUTENSOR_R_16I",
"CUTENSOR_PLAN_REQUIRED_WORKSPACE",
"CUTENSOR_PLAN_PREFERENCE_KERNEL_RANK",
"CUTENSOR_PLAN_PREFERENCE_JIT",
"CUTENSOR_PLAN_PREFERENCE_INCREMENTAL_COUNT",
"CUTENSOR_PLAN_PREFERENCE_CACHE_MODE",
"CUTENSOR_PLAN_PREFERENCE_AUTOTUNE_MODE",
"CUTENSOR_PLAN_PREFERENCE_ALGO",
"CUTENSOR_OP_TANH",
"CUTENSOR_OP_TAN",
"CUTENSOR_OP_SWISH",
Expand Down Expand Up @@ -12667,6 +12685,15 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_OP_ACOSH",
"CUTENSOR_OP_ACOS",
"CUTENSOR_OP_ABS",
"CUTENSOR_OPERATION_DESCRIPTOR_TAG",
"CUTENSOR_OPERATION_DESCRIPTOR_SCALAR_TYPE",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_VALUE",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_RIGHT",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_LEFT",
"CUTENSOR_OPERATION_DESCRIPTOR_MOVED_BYTES",
"CUTENSOR_OPERATION_DESCRIPTOR_FLOPS",
"CUTENSOR_JIT_MODE_NONE",
"CUTENSOR_JIT_MODE_DEFAULT",
"CUTENSOR_C_8U",
"CUTENSOR_C_8I",
"CUTENSOR_C_64U",
Expand All @@ -12679,6 +12706,10 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_C_16I",
"CUTENSOR_C_16F",
"CUTENSOR_C_16BF",
"CUTENSOR_CACHE_MODE_PEDANTIC",
"CUTENSOR_CACHE_MODE_NONE",
"CUTENSOR_AUTOTUNE_MODE_NONE",
"CUTENSOR_AUTOTUNE_MODE_INCREMENTAL",
"CUTENSOR_ALGO_TTGT",
"CUTENSOR_ALGO_TGETT",
"CUTENSOR_ALGO_GETT",
Expand Down Expand Up @@ -14248,6 +14279,12 @@ sub warnRocOnlyUnsupportedFunctions {
my $line_num = shift;
my $k = 0;
foreach $func (
"cutensorPlanPreferenceAttribute_t",
"cutensorPlanAttribute_t",
"cutensorOperationDescriptorAttribute_t",
"cutensorJitMode_t",
"cutensorCacheMode_t",
"cutensorAutotuneMode_t",
"cusparseZhybsv_solve",
"cusparseZhybsv_analysis",
"cusparseZhyb2dense",
Expand Down Expand Up @@ -14925,6 +14962,7 @@ sub warnRocOnlyUnsupportedFunctions {
"csru2csrInfo_t",
"csru2csrInfo",
"__curand_umul",
"CUTENSOR_WORKSPACE_DEFAULT",
"CUTENSOR_STATUS_MAPPING_ERROR",
"CUTENSOR_STATUS_LICENSE_ERROR",
"CUTENSOR_STATUS_CUDA_ERROR",
Expand All @@ -14935,6 +14973,13 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_R_4I",
"CUTENSOR_R_16U",
"CUTENSOR_R_16I",
"CUTENSOR_PLAN_REQUIRED_WORKSPACE",
"CUTENSOR_PLAN_PREFERENCE_KERNEL_RANK",
"CUTENSOR_PLAN_PREFERENCE_JIT",
"CUTENSOR_PLAN_PREFERENCE_INCREMENTAL_COUNT",
"CUTENSOR_PLAN_PREFERENCE_CACHE_MODE",
"CUTENSOR_PLAN_PREFERENCE_AUTOTUNE_MODE",
"CUTENSOR_PLAN_PREFERENCE_ALGO",
"CUTENSOR_OP_TANH",
"CUTENSOR_OP_TAN",
"CUTENSOR_OP_SWISH",
Expand Down Expand Up @@ -14965,6 +15010,15 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_OP_ACOSH",
"CUTENSOR_OP_ACOS",
"CUTENSOR_OP_ABS",
"CUTENSOR_OPERATION_DESCRIPTOR_TAG",
"CUTENSOR_OPERATION_DESCRIPTOR_SCALAR_TYPE",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_VALUE",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_RIGHT",
"CUTENSOR_OPERATION_DESCRIPTOR_PADDING_LEFT",
"CUTENSOR_OPERATION_DESCRIPTOR_MOVED_BYTES",
"CUTENSOR_OPERATION_DESCRIPTOR_FLOPS",
"CUTENSOR_JIT_MODE_NONE",
"CUTENSOR_JIT_MODE_DEFAULT",
"CUTENSOR_C_8U",
"CUTENSOR_C_8I",
"CUTENSOR_C_64U",
Expand All @@ -14977,6 +15031,10 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_C_16I",
"CUTENSOR_C_16F",
"CUTENSOR_C_16BF",
"CUTENSOR_CACHE_MODE_PEDANTIC",
"CUTENSOR_CACHE_MODE_NONE",
"CUTENSOR_AUTOTUNE_MODE_NONE",
"CUTENSOR_AUTOTUNE_MODE_INCREMENTAL",
"CUTENSOR_ALGO_TTGT",
"CUTENSOR_ALGO_TGETT",
"CUTENSOR_ALGO_GETT",
Expand Down
31 changes: 31 additions & 0 deletions docs/tables/CUTENSOR_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
|`CUTENSOR_ALGO_GETT`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_ALGO_TGETT`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_ALGO_TTGT`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_AUTOTUNE_MODE_INCREMENTAL`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_AUTOTUNE_MODE_NONE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_CACHE_MODE_NONE`|1.2.0.0| | | | | | | | | |
|`CUTENSOR_CACHE_MODE_PEDANTIC`|1.2.0.0| | | | | | | | | |
|`CUTENSOR_C_16BF`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_C_16F`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_C_16I`|2.0.0.0| | | | | | | | | |
Expand All @@ -23,6 +27,15 @@
|`CUTENSOR_C_64U`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_C_8I`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_C_8U`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_JIT_MODE_DEFAULT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_JIT_MODE_NONE`|2.0.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| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_PADDING_RIGHT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_PADDING_VALUE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_SCALAR_TYPE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OPERATION_DESCRIPTOR_TAG`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OP_ABS`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ACOS`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ACOSH`|1.0.1.0| | | | | | | | | |
Expand Down Expand Up @@ -56,6 +69,13 @@
|`CUTENSOR_OP_TAN`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_TANH`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_UNKNOWN`|1.0.1.0| | | |`HIPTENSOR_OP_UNKNOWN`|5.7.0| | | | |
|`CUTENSOR_PLAN_PREFERENCE_ALGO`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_PREFERENCE_AUTOTUNE_MODE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_PREFERENCE_CACHE_MODE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_PREFERENCE_INCREMENTAL_COUNT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_PREFERENCE_JIT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_PREFERENCE_KERNEL_RANK`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_PLAN_REQUIRED_WORKSPACE`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_R_16BF`|2.0.0.0| | | |`HIPTENSOR_COMPUTE_16BF`|5.7.0| | | | |
|`CUTENSOR_R_16F`|2.0.0.0| | | |`HIPTENSOR_COMPUTE_16F`|5.7.0| | | | |
|`CUTENSOR_R_16I`|2.0.0.0| | | | | | | | | |
Expand Down Expand Up @@ -85,10 +105,21 @@
|`CUTENSOR_STATUS_NOT_INITIALIZED`| | | | |`HIPTENSOR_STATUS_NOT_INITIALIZED`| | | | | |
|`CUTENSOR_STATUS_NOT_SUPPORTED`| | | | |`HIPTENSOR_STATUS_NOT_SUPPORTED`| | | | | |
|`CUTENSOR_STATUS_SUCCESS`| | | | |`HIPTENSOR_STATUS_SUCCESS`| | | | | |
|`CUTENSOR_WORKSPACE_DEFAULT`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_WORKSPACE_MAX`|1.0.1.0| | | |`HIPTENSOR_WORKSPACE_MAX`|5.7.0| | | | |
|`CUTENSOR_WORKSPACE_MIN`|1.0.1.0| | | |`HIPTENSOR_WORKSPACE_MIN`|5.7.0| | | | |
|`CUTENSOR_WORKSPACE_RECOMMENDED`|1.0.1.0| | |2.0.0.0|`HIPTENSOR_WORKSPACE_RECOMMENDED`|5.7.0| | | | |
|`cutensorAlgo_t`|1.0.1.0| | | |`hiptensorAlgo_t`|5.7.0| | | | |
|`cutensorAutotuneMode_t`|1.2.0.0| | | | | | | | | |
|`cutensorCacheMode_t`|1.2.0.0| | | | | | | | | |
|`cutensorDataType_t`|2.0.0.0| | | |`hiptensorComputeType_t`|5.7.0| | | | |
|`cutensorJitMode_t`|2.0.0.0| | | | | | | | | |
|`cutensorOperationDescriptorAttribute_t`|2.0.0.0| | | | | | | | | |
|`cutensorOperator_t`|1.0.1.0| | | |`hiptensorOperator_t`|5.7.0| | | | |
|`cutensorPlanAttribute_t`|2.0.0.0| | | | | | | | | |
|`cutensorPlanPreferenceAttribute_t`|2.0.0.0| | | | | | | | | |
|`cutensorStatus_t`| | | | |`hiptensorStatus_t`| | | | | |
|`cutensorWorksizePreference_t`|1.0.1.0| | | |`hiptensorWorksizePreference_t`|5.7.0| | | | |

## **2. CUTENSOR Function Reference**

Expand Down
Loading

0 comments on commit 62ce2b1

Please sign in to comment.