diff --git a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.td b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.td index 4613627..f4f2d85 100644 --- a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.td +++ b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops.td @@ -179,9 +179,10 @@ def LHLOGPU_GEMMOp : LHLOGPU_Op<"gemm"> { Arg:$rhs, Arg:$output, DotDimensionNumbers:$dot_dimension_numbers, - F64Attr:$alpha, + F64Attr:$alpha_real, + F64Attr:$alpha_imag, I64Attr:$batch_size, - I64Attr:$algorithm); + OptionalAttr:$algorithm); } // output = alpha(lhs * rhs) + beta * bias @@ -192,10 +193,11 @@ def LHLOGPU_GEMM_BiasOp : LHLOGPU_Op<"gemm_bias"> { Arg:$bias, Arg:$output, DotDimensionNumbers:$dot_dimension_numbers, - F64Attr:$alpha, + F64Attr:$alpha_real, + F64Attr:$alpha_imag, F64Attr:$beta, I64Attr:$batch_size, - I64Attr:$algorithm); + OptionalAttr:$algorithm); } def LHLOGPU_CholeskyOp : LHLOGPU_Op<"cholesky"> { diff --git a/tests/lhlo_gpu_ops.mlir b/tests/lhlo_gpu_ops.mlir index a939cab..bd5df38 100644 --- a/tests/lhlo_gpu_ops.mlir +++ b/tests/lhlo_gpu_ops.mlir @@ -65,7 +65,8 @@ func @gemm(%lhs: memref<5x4xf32>, %rhs: memref<4x5xf32>, %output:memref<5x5xf32> rhs_batching_dimensions = dense<[1,1]> : tensor<2xi64>, lhs_contracting_dimensions = dense<[1,1]> : tensor<2xi64>, rhs_contracting_dimensions = dense<[1,1]> : tensor<2xi64>}, - alpha = 0.5, + alpha_real = 0.5, + alpha_imag = 0.0, batch_size = 1, algorithm = 0} : (memref<5x4xf32>, memref<4x5xf32>, memref<5x5xf32>) -> () @@ -81,7 +82,8 @@ func @gemm_bias(%lhs: memref<5x4xf32>, %rhs: memref<4x5xf32>, rhs_batching_dimensions = dense<[1,1]> : tensor<2xi64>, lhs_contracting_dimensions = dense<[1,1]> : tensor<2xi64>, rhs_contracting_dimensions = dense<[1,1]> : tensor<2xi64>}, - alpha = 0.5, + alpha_real = 0.5, + alpha_imag = 0.0, beta = 1.0, batch_size = 1, algorithm = 0}