@@ -843,6 +843,45 @@ def inverse_value_func(arg_types: Mapping[str, type], arg_values: Mapping[str, A
843843 require_original_output_arg = True ,
844844)
845845
846+ add_builtin (
847+ "inverse_approx" ,
848+ input_types = {"a" : matrix (shape = (2 , 2 ), dtype = Float )},
849+ value_func = inverse_value_func ,
850+ native_func = "approx_inverse" ,
851+ group = "Vector Math" ,
852+ doc = """Compute the inverse of matrix ``a`` using approximate GPU intrinsics.
853+
854+ Falls back to exact inverse on CPU.""" ,
855+ require_original_output_arg = True ,
856+ export = False ,
857+ )
858+
859+ add_builtin (
860+ "inverse_approx" ,
861+ input_types = {"a" : matrix (shape = (3 , 3 ), dtype = Float )},
862+ value_func = inverse_value_func ,
863+ native_func = "approx_inverse" ,
864+ group = "Vector Math" ,
865+ doc = """Compute the inverse of matrix ``a`` using approximate GPU intrinsics.
866+
867+ Falls back to exact inverse on CPU.""" ,
868+ require_original_output_arg = True ,
869+ export = False ,
870+ )
871+
872+ add_builtin (
873+ "inverse_approx" ,
874+ input_types = {"a" : matrix (shape = (4 , 4 ), dtype = Float )},
875+ value_func = inverse_value_func ,
876+ native_func = "approx_inverse" ,
877+ group = "Vector Math" ,
878+ doc = """Compute the inverse of matrix ``a`` using approximate GPU intrinsics.
879+
880+ Falls back to exact inverse on CPU.""" ,
881+ require_original_output_arg = True ,
882+ export = False ,
883+ )
884+
846885
847886def determinant_value_func (arg_types : Mapping [str , type ], arg_values : Mapping [str , Any ]):
848887 if arg_types is None :
@@ -11079,6 +11118,89 @@ def matmat_mul_value_func(arg_types: Mapping[str, type], arg_values: Mapping[str
1107911118 group = "Operators" ,
1108011119)
1108111120
11121+ add_builtin (
11122+ "div_approx" ,
11123+ input_types = {"a" : Float , "b" : Float },
11124+ value_func = sametypes_create_value_func (Float ),
11125+ native_func = "approx_div" ,
11126+ doc = """Divide two values using approximate GPU intrinsics.
11127+
11128+ Falls back to exact division on CPU.""" ,
11129+ group = "Operators" ,
11130+ require_original_output_arg = True ,
11131+ export = False ,
11132+ )
11133+ add_builtin (
11134+ "div_approx" ,
11135+ input_types = {"a" : vector (length = Any , dtype = Float ), "b" : Float },
11136+ value_func = scalar_mul_create_value_func (vector (length = Any , dtype = Float )),
11137+ native_func = "approx_div" ,
11138+ doc = """Divide two values using approximate GPU intrinsics.
11139+
11140+ Divide a vector by a scalar. Falls back to exact division on CPU.""" ,
11141+ group = "Operators" ,
11142+ export = False ,
11143+ )
11144+ add_builtin (
11145+ "div_approx" ,
11146+ input_types = {"a" : Float , "b" : vector (length = Any , dtype = Float )},
11147+ value_func = scalar_mul_create_value_func (vector (length = Any , dtype = Float )),
11148+ native_func = "approx_div" ,
11149+ doc = """Divide two values using approximate GPU intrinsics.
11150+
11151+ Divide a scalar by each element of a vector. Falls back to exact division on CPU.""" ,
11152+ group = "Operators" ,
11153+ export = False ,
11154+ )
11155+ add_builtin (
11156+ "div_approx" ,
11157+ input_types = {"a" : matrix (shape = (Any , Any ), dtype = Float ), "b" : Float },
11158+ value_func = scalar_mul_create_value_func (matrix (shape = (Any , Any ), dtype = Float )),
11159+ native_func = "approx_div" ,
11160+ doc = """Divide two values using approximate GPU intrinsics.
11161+
11162+ Divide a matrix by a scalar. Falls back to exact division on CPU.""" ,
11163+ group = "Operators" ,
11164+ export = False ,
11165+ )
11166+ add_builtin (
11167+ "div_approx" ,
11168+ input_types = {"a" : Float , "b" : matrix (shape = (Any , Any ), dtype = Float )},
11169+ value_func = scalar_mul_create_value_func (matrix (shape = (Any , Any ), dtype = Float )),
11170+ native_func = "approx_div" ,
11171+ doc = """Divide two values using approximate GPU intrinsics.
11172+
11173+ Divide a scalar by each element of a matrix. Falls back to exact division on CPU.""" ,
11174+ group = "Operators" ,
11175+ export = False ,
11176+ )
11177+ add_builtin (
11178+ "div_approx" ,
11179+ input_types = {"a" : quaternion (dtype = Float ), "b" : Float },
11180+ value_func = scalar_mul_create_value_func (quaternion (dtype = Float )),
11181+ native_func = "approx_div" ,
11182+ doc = """Divide two values using approximate GPU intrinsics.
11183+
11184+ Divide a quaternion by a scalar.
11185+
11186+ The result is unnormalized. Falls back to exact division on CPU.""" ,
11187+ group = "Operators" ,
11188+ export = False ,
11189+ )
11190+ add_builtin (
11191+ "div_approx" ,
11192+ input_types = {"a" : Float , "b" : quaternion (dtype = Float )},
11193+ value_func = scalar_mul_create_value_func (quaternion (dtype = Float )),
11194+ native_func = "approx_div" ,
11195+ doc = """Divide two values using approximate GPU intrinsics.
11196+
11197+ Divide a scalar by a quaternion.
11198+
11199+ The result is unnormalized. Falls back to exact division on CPU.""" ,
11200+ group = "Operators" ,
11201+ export = False ,
11202+ )
11203+
1108211204add_builtin (
1108311205 "floordiv" ,
1108411206 input_types = {"a" : Scalar , "b" : Scalar },
0 commit comments