Add missing lowering step for IsFiniteOp.

Also add a BUILD target for generating the GPU kernel.

PiperOrigin-RevId: 334993362
This commit is contained in:
Adrian Kuegel 2020-10-02 03:07:56 -07:00 committed by TensorFlow MLIR Team
parent 5f303440da
commit 3eb767b43d
2 changed files with 13 additions and 1 deletions

View File

@ -506,6 +506,7 @@ void populateHLOToLHLOConversionPattern(
HloToLhloOpConverter<mhlo::GatherOp>, HloToLhloOpConverter<mhlo::GatherOp>,
HloToLhloOpConverter<mhlo::ImagOp>, HloToLhloOpConverter<mhlo::ImagOp>,
HloToLhloOpConverter<mhlo::IotaOp>, HloToLhloOpConverter<mhlo::IotaOp>,
HloToLhloOpConverter<mhlo::IsFiniteOp>,
HloToLhloOpConverter<mhlo::LogOp>, HloToLhloOpConverter<mhlo::LogOp>,
HloToLhloOpConverter<mhlo::MaxOp>, HloToLhloOpConverter<mhlo::MaxOp>,
HloToLhloOpConverter<mhlo::MinOp>, HloToLhloOpConverter<mhlo::MinOp>,

View File

@ -601,3 +601,14 @@ func @custom_call(%arg0: memref<2x2xf32>, %arg1: memref<2x3xf32>, %result: memre
tensor_store %result_tensor, %result: memref<4x4xf16> tensor_store %result_tensor, %result: memref<4x4xf16>
return return
} }
// ----
// BOTH-LABEL: func @isfinite
func @isfinite(%arg0: memref<2x2xf32>, %result: memref<2x2xi1>) {
%arg0_tensor = tensor_load %arg0 : memref<2x2xf32>
// BOTH: "lmhlo.is_finite"(%{{.*}}, %{{.*}})
%result_tensor = "mhlo.is_finite"(%arg0_tensor) : (tensor<2x2xf32>) -> tensor<2x2xi1>
tensor_store %result_tensor, %result: memref<2x2xi1>
return
}