Skip to content

Commit

Permalink
Merge pull request #1778 from aakanksha555/amd-staging
Browse files Browse the repository at this point in the history
[HIPIFY][Tensor][feature] hipTensor-rocm-6.3.0 support - Data Types
  • Loading branch information
emankov authored Dec 5, 2024
2 parents 81cc550 + f7cccb0 commit 9fd37a9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
12 changes: 4 additions & 8 deletions bin/hipify-perl
Original file line number Diff line number Diff line change
Expand Up @@ -7849,7 +7849,11 @@ sub simpleSubstitutions {
subst("CUTENSOR_ALGO_DEFAULT_PATIENT", "HIPTENSOR_ALGO_DEFAULT_PATIENT", "numeric_literal");
subst("CUTENSOR_C_32F", "HIPTENSOR_COMPUTE_C32F", "numeric_literal");
subst("CUTENSOR_C_64F", "HIPTENSOR_COMPUTE_C64F", "numeric_literal");
subst("CUTENSOR_OP_ADD", "HIPTENSOR_OP_ADD", "numeric_literal");
subst("CUTENSOR_OP_IDENTITY", "HIPTENSOR_OP_IDENTITY", "numeric_literal");
subst("CUTENSOR_OP_MAX", "HIPTENSOR_OP_MAX", "numeric_literal");
subst("CUTENSOR_OP_MIN", "HIPTENSOR_OP_MIN", "numeric_literal");
subst("CUTENSOR_OP_MUL", "HIPTENSOR_OP_MUL", "numeric_literal");
subst("CUTENSOR_OP_SQRT", "HIPTENSOR_OP_SQRT", "numeric_literal");
subst("CUTENSOR_OP_UNKNOWN", "HIPTENSOR_OP_UNKNOWN", "numeric_literal");
subst("CUTENSOR_R_16BF", "HIPTENSOR_COMPUTE_16BF", "numeric_literal");
Expand Down Expand Up @@ -10180,10 +10184,7 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_OP_RELU",
"CUTENSOR_OP_RCP",
"CUTENSOR_OP_NEG",
"CUTENSOR_OP_MUL",
"CUTENSOR_OP_MISH",
"CUTENSOR_OP_MIN",
"CUTENSOR_OP_MAX",
"CUTENSOR_OP_LOG",
"CUTENSOR_OP_FLOOR",
"CUTENSOR_OP_EXP",
Expand All @@ -10195,7 +10196,6 @@ sub warnHipOnlyUnsupportedFunctions {
"CUTENSOR_OP_ATAN",
"CUTENSOR_OP_ASINH",
"CUTENSOR_OP_ASIN",
"CUTENSOR_OP_ADD",
"CUTENSOR_OP_ACOSH",
"CUTENSOR_OP_ACOS",
"CUTENSOR_OP_ABS",
Expand Down Expand Up @@ -11594,10 +11594,7 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_OP_RELU",
"CUTENSOR_OP_RCP",
"CUTENSOR_OP_NEG",
"CUTENSOR_OP_MUL",
"CUTENSOR_OP_MISH",
"CUTENSOR_OP_MIN",
"CUTENSOR_OP_MAX",
"CUTENSOR_OP_LOG",
"CUTENSOR_OP_FLOOR",
"CUTENSOR_OP_EXP",
Expand All @@ -11609,7 +11606,6 @@ sub warnRocOnlyUnsupportedFunctions {
"CUTENSOR_OP_ATAN",
"CUTENSOR_OP_ASINH",
"CUTENSOR_OP_ASIN",
"CUTENSOR_OP_ADD",
"CUTENSOR_OP_ACOSH",
"CUTENSOR_OP_ACOS",
"CUTENSOR_OP_ABS",
Expand Down
8 changes: 4 additions & 4 deletions docs/tables/CUTENSOR_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
|`CUTENSOR_OP_ABS`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ACOS`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ACOSH`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ADD`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ADD`|1.0.1.0| | | |`HIPTENSOR_OP_ADD`|6.3.0| | | | |
|`CUTENSOR_OP_ASIN`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ASINH`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_ATAN`|1.0.1.0| | | | | | | | | |
Expand All @@ -52,10 +52,10 @@
|`CUTENSOR_OP_FLOOR`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_IDENTITY`|1.0.1.0| | | |`HIPTENSOR_OP_IDENTITY`|5.7.0| | | | |
|`CUTENSOR_OP_LOG`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_MAX`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_MIN`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_MAX`|1.0.1.0| | | |`HIPTENSOR_OP_MAX`|6.3.0| | | | |
|`CUTENSOR_OP_MIN`|1.0.1.0| | | |`HIPTENSOR_OP_MIN`|6.3.0| | | | |
|`CUTENSOR_OP_MISH`|2.0.0.0| | | | | | | | | |
|`CUTENSOR_OP_MUL`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_MUL`|1.0.1.0| | | |`HIPTENSOR_OP_MUL`|6.3.0| | | | |
|`CUTENSOR_OP_NEG`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_RCP`|1.0.1.0| | | | | | | | | |
|`CUTENSOR_OP_RELU`|1.0.1.0| | | | | | | | | |
Expand Down
12 changes: 8 additions & 4 deletions src/CUDA2HIP_TENSOR_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ const std::map<llvm::StringRef, hipCounter> CUDA_TENSOR_TYPE_NAME_MAP {
{"CUTENSOR_OP_SWISH", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_SOFT_PLUS", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_SOFT_SIGN", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_ADD", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_MUL", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_MAX", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_MIN", {"", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1, UNSUPPORTED}},
{"CUTENSOR_OP_ADD", {"HIPTENSOR_OP_ADD", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1}},
{"CUTENSOR_OP_MUL", {"HIPTENSOR_OP_MUL", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1}},
{"CUTENSOR_OP_MAX", {"HIPTENSOR_OP_MAX", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1}},
{"CUTENSOR_OP_MIN", {"HIPTENSOR_OP_MIN", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1}},
{"CUTENSOR_OP_UNKNOWN", {"HIPTENSOR_OP_UNKNOWN", "", CONV_NUMERIC_LITERAL, API_TENSOR, 1}},

{"cutensorStatus_t", {"hiptensorStatus_t", "", CONV_TYPE, API_TENSOR, 1}},
Expand Down Expand Up @@ -274,6 +274,10 @@ const std::map<llvm::StringRef, hipAPIversions> HIP_TENSOR_TYPE_NAME_VER_MAP {
{"hiptensorOperator_t", {HIP_5070, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_IDENTITY", {HIP_5070, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_SQRT", {HIP_6020, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_ADD", {HIP_6030, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_MUL", {HIP_6030, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_MAX", {HIP_6030, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_MIN", {HIP_6030, HIP_0, HIP_0, }},
{"HIPTENSOR_OP_UNKNOWN", {HIP_5070, HIP_0, HIP_0, }},
{"hiptensorAlgo_t", {HIP_5070, HIP_0, HIP_0, }},
{"HIPTENSOR_ALGO_DEFAULT", {HIP_5070, HIP_0, HIP_0, }},
Expand Down
8 changes: 8 additions & 0 deletions tests/unit_tests/synthetic/libraries/cutensor2hiptensor.cu
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ int main() {
// CHECK: hiptensorOperator_t tensorOperator_t;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_IDENTITY = HIPTENSOR_OP_IDENTITY;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_SQRT = HIPTENSOR_OP_SQRT;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_ADD = HIPTENSOR_OP_ADD;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_MUL = HIPTENSOR_OP_MUL;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_MAX = HIPTENSOR_OP_MAX;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_MIN = HIPTENSOR_OP_MIN;
// CHECK-NEXT hiptensorOperator_t TENSOR_OP_UNKNOWN = HIPTENSOR_OP_UNKNOWN;
cutensorOperator_t tensorOperator_t;
cutensorOperator_t TENSOR_OP_IDENTITY = CUTENSOR_OP_IDENTITY;
cutensorOperator_t TENSOR_OP_SQRT = CUTENSOR_OP_SQRT;
cutensorOperator_t TENSOR_OP_ADD = CUTENSOR_OP_ADD;
cutensorOperator_t TENSOR_OP_MUL = CUTENSOR_OP_MUL;
cutensorOperator_t TENSOR_OP_MAX = CUTENSOR_OP_MAX;
cutensorOperator_t TENSOR_OP_MIN = CUTENSOR_OP_MIN;
cutensorOperator_t TENSOR_OP_UNKNOWN = CUTENSOR_OP_UNKNOWN;

// CHECK: hiptensorStatus_t tensorStatus_t;
Expand Down

0 comments on commit 9fd37a9

Please sign in to comment.