Fixed macros in the benches

This commit is contained in:
Connorcpu 2014-12-19 10:06:39 -08:00
parent 43cfdd94ec
commit 6e9cd482eb
5 changed files with 74 additions and 74 deletions

View file

@ -36,7 +36,7 @@ macro_rules! bench_binop(
})
}
}
)
);
macro_rules! bench_binop_deref(
($name: ident, $t1: ty, $t2: ty, $binop: ident) => {
@ -59,7 +59,7 @@ macro_rules! bench_binop_deref(
})
}
}
)
);
macro_rules! bench_unop(
($name: ident, $t: ty, $unop: ident) => {
@ -81,7 +81,7 @@ macro_rules! bench_unop(
})
}
}
)
);
macro_rules! bench_construction(
($name: ident, $t: ty, $constructor: path $(, $args: ident: $types: ty)*) => {
@ -104,4 +104,4 @@ macro_rules! bench_construction(
})
}
}
)
);

View file

@ -54,7 +54,7 @@ fn _bench_rot3_from_axisangle(bh: &mut Bencher) {
bench_from_axis_angle::<Basis3<f32>>(bh)
}
bench_construction!(_bench_rot2_from_axisangle, Basis2<f32>, Rotation2::from_angle, angle: Rad<f32>)
bench_construction!(_bench_rot2_from_axisangle, Basis2<f32>, Rotation2::from_angle, angle: Rad<f32>);
bench_construction!(_bench_quat_from_euler_angles, Quaternion<f32>, Rotation3::from_euler, roll: Rad<f32>, pitch: Rad<f32>, yaw: Rad<f32>)
bench_construction!(_bench_rot3_from_euler_angles, Basis3<f32>, Rotation3::from_euler, roll: Rad<f32>, pitch: Rad<f32>, yaw: Rad<f32>)
bench_construction!(_bench_quat_from_euler_angles, Quaternion<f32>, Rotation3::from_euler, roll: Rad<f32>, pitch: Rad<f32>, yaw: Rad<f32>);
bench_construction!(_bench_rot3_from_euler_angles, Basis3<f32>, Rotation3::from_euler, roll: Rad<f32>, pitch: Rad<f32>, yaw: Rad<f32>);

View file

@ -26,34 +26,34 @@ use cgmath::*;
#[path="common/macros.rs"]
mod macros;
bench_binop!(_bench_matrix2_mul_m, Matrix2<f32>, Matrix2<f32>, mul_m)
bench_binop!(_bench_matrix3_mul_m, Matrix3<f32>, Matrix3<f32>, mul_m)
bench_binop!(_bench_matrix4_mul_m, Matrix4<f32>, Matrix4<f32>, mul_m)
bench_binop!(_bench_matrix2_mul_m, Matrix2<f32>, Matrix2<f32>, mul_m);
bench_binop!(_bench_matrix3_mul_m, Matrix3<f32>, Matrix3<f32>, mul_m);
bench_binop!(_bench_matrix4_mul_m, Matrix4<f32>, Matrix4<f32>, mul_m);
bench_binop!(_bench_matrix2_add_m, Matrix2<f32>, Matrix2<f32>, add_m)
bench_binop!(_bench_matrix3_add_m, Matrix3<f32>, Matrix3<f32>, add_m)
bench_binop!(_bench_matrix4_add_m, Matrix4<f32>, Matrix4<f32>, add_m)
bench_binop!(_bench_matrix2_add_m, Matrix2<f32>, Matrix2<f32>, add_m);
bench_binop!(_bench_matrix3_add_m, Matrix3<f32>, Matrix3<f32>, add_m);
bench_binop!(_bench_matrix4_add_m, Matrix4<f32>, Matrix4<f32>, add_m);
bench_binop!(_bench_matrix2_sub_m, Matrix2<f32>, Matrix2<f32>, sub_m)
bench_binop!(_bench_matrix3_sub_m, Matrix3<f32>, Matrix3<f32>, sub_m)
bench_binop!(_bench_matrix4_sub_m, Matrix4<f32>, Matrix4<f32>, sub_m)
bench_binop!(_bench_matrix2_sub_m, Matrix2<f32>, Matrix2<f32>, sub_m);
bench_binop!(_bench_matrix3_sub_m, Matrix3<f32>, Matrix3<f32>, sub_m);
bench_binop!(_bench_matrix4_sub_m, Matrix4<f32>, Matrix4<f32>, sub_m);
bench_binop!(_bench_matrix2_mul_v, Matrix2<f32>, Vector2<f32>, mul_v)
bench_binop!(_bench_matrix3_mul_v, Matrix3<f32>, Vector3<f32>, mul_v)
bench_binop!(_bench_matrix4_mul_v, Matrix4<f32>, Vector4<f32>, mul_v)
bench_binop!(_bench_matrix2_mul_v, Matrix2<f32>, Vector2<f32>, mul_v);
bench_binop!(_bench_matrix3_mul_v, Matrix3<f32>, Vector3<f32>, mul_v);
bench_binop!(_bench_matrix4_mul_v, Matrix4<f32>, Vector4<f32>, mul_v);
bench_binop_deref!(_bench_matrix2_mul_s, Matrix2<f32>, f32, mul_s)
bench_binop_deref!(_bench_matrix3_mul_s, Matrix3<f32>, f32, mul_s)
bench_binop_deref!(_bench_matrix4_mul_s, Matrix4<f32>, f32, mul_s)
bench_binop_deref!(_bench_matrix2_mul_s, Matrix2<f32>, f32, mul_s);
bench_binop_deref!(_bench_matrix3_mul_s, Matrix3<f32>, f32, mul_s);
bench_binop_deref!(_bench_matrix4_mul_s, Matrix4<f32>, f32, mul_s);
bench_binop_deref!(_bench_matrix2_div_s, Matrix2<f32>, f32, div_s)
bench_binop_deref!(_bench_matrix3_div_s, Matrix3<f32>, f32, div_s)
bench_binop_deref!(_bench_matrix4_div_s, Matrix4<f32>, f32, div_s)
bench_binop_deref!(_bench_matrix2_div_s, Matrix2<f32>, f32, div_s);
bench_binop_deref!(_bench_matrix3_div_s, Matrix3<f32>, f32, div_s);
bench_binop_deref!(_bench_matrix4_div_s, Matrix4<f32>, f32, div_s);
bench_unop!(_bench_matrix2_invert, Matrix2<f32>, invert)
bench_unop!(_bench_matrix3_invert, Matrix3<f32>, invert)
bench_unop!(_bench_matrix4_invert, Matrix4<f32>, invert)
bench_unop!(_bench_matrix2_invert, Matrix2<f32>, invert);
bench_unop!(_bench_matrix3_invert, Matrix3<f32>, invert);
bench_unop!(_bench_matrix4_invert, Matrix4<f32>, invert);
bench_unop!(_bench_matrix2_transpose, Matrix2<f32>, transpose)
bench_unop!(_bench_matrix3_transpose, Matrix3<f32>, transpose)
bench_unop!(_bench_matrix4_transpose, Matrix4<f32>, transpose)
bench_unop!(_bench_matrix2_transpose, Matrix2<f32>, transpose);
bench_unop!(_bench_matrix3_transpose, Matrix3<f32>, transpose);
bench_unop!(_bench_matrix4_transpose, Matrix4<f32>, transpose);

View file

@ -26,12 +26,12 @@ use cgmath::*;
#[path="common/macros.rs"]
mod macros;
bench_binop!(_bench_quat_add_q, Quaternion<f32>, Quaternion<f32>, add_q)
bench_binop!(_bench_quat_sub_q, Quaternion<f32>, Quaternion<f32>, sub_q)
bench_binop!(_bench_quat_mul_q, Quaternion<f32>, Quaternion<f32>, mul_q)
bench_binop!(_bench_quat_mul_v, Quaternion<f32>, Vector3<f32>, mul_v)
bench_binop_deref!(_bench_quat_mul_s, Quaternion<f32>, f32, mul_s)
bench_binop_deref!(_bench_quat_div_s, Quaternion<f32>, f32, div_s)
bench_unop!(_bench_quat_invert, Quaternion<f32>, invert)
bench_unop!(_bench_quat_conjugate, Quaternion<f32>, conjugate)
bench_unop!(_bench_quat_normalize, Quaternion<f32>, normalize)
bench_binop!(_bench_quat_add_q, Quaternion<f32>, Quaternion<f32>, add_q);
bench_binop!(_bench_quat_sub_q, Quaternion<f32>, Quaternion<f32>, sub_q);
bench_binop!(_bench_quat_mul_q, Quaternion<f32>, Quaternion<f32>, mul_q);
bench_binop!(_bench_quat_mul_v, Quaternion<f32>, Vector3<f32>, mul_v);
bench_binop_deref!(_bench_quat_mul_s, Quaternion<f32>, f32, mul_s);
bench_binop_deref!(_bench_quat_div_s, Quaternion<f32>, f32, div_s);
bench_unop!(_bench_quat_invert, Quaternion<f32>, invert);
bench_unop!(_bench_quat_conjugate, Quaternion<f32>, conjugate);
bench_unop!(_bench_quat_normalize, Quaternion<f32>, normalize);

View file

@ -26,49 +26,49 @@ use cgmath::*;
#[path="common/macros.rs"]
mod macros;
bench_binop!(_bench_vector2_add_v, Vector2<f32>, Vector2<f32>, add_v)
bench_binop!(_bench_vector3_add_v, Vector3<f32>, Vector3<f32>, add_v)
bench_binop!(_bench_vector4_add_v, Vector4<f32>, Vector4<f32>, add_v)
bench_binop!(_bench_vector2_add_v, Vector2<f32>, Vector2<f32>, add_v);
bench_binop!(_bench_vector3_add_v, Vector3<f32>, Vector3<f32>, add_v);
bench_binop!(_bench_vector4_add_v, Vector4<f32>, Vector4<f32>, add_v);
bench_binop!(_bench_vector2_sub_v, Vector2<f32>, Vector2<f32>, sub_v)
bench_binop!(_bench_vector3_sub_v, Vector3<f32>, Vector3<f32>, sub_v)
bench_binop!(_bench_vector4_sub_v, Vector4<f32>, Vector4<f32>, sub_v)
bench_binop!(_bench_vector2_sub_v, Vector2<f32>, Vector2<f32>, sub_v);
bench_binop!(_bench_vector3_sub_v, Vector3<f32>, Vector3<f32>, sub_v);
bench_binop!(_bench_vector4_sub_v, Vector4<f32>, Vector4<f32>, sub_v);
bench_binop!(_bench_vector2_mul_v, Vector2<f32>, Vector2<f32>, mul_v)
bench_binop!(_bench_vector3_mul_v, Vector3<f32>, Vector3<f32>, mul_v)
bench_binop!(_bench_vector4_mul_v, Vector4<f32>, Vector4<f32>, mul_v)
bench_binop!(_bench_vector2_mul_v, Vector2<f32>, Vector2<f32>, mul_v);
bench_binop!(_bench_vector3_mul_v, Vector3<f32>, Vector3<f32>, mul_v);
bench_binop!(_bench_vector4_mul_v, Vector4<f32>, Vector4<f32>, mul_v);
bench_binop!(_bench_vector2_div_v, Vector2<f32>, Vector2<f32>, div_v)
bench_binop!(_bench_vector3_div_v, Vector3<f32>, Vector3<f32>, div_v)
bench_binop!(_bench_vector4_div_v, Vector4<f32>, Vector4<f32>, div_v)
bench_binop!(_bench_vector2_div_v, Vector2<f32>, Vector2<f32>, div_v);
bench_binop!(_bench_vector3_div_v, Vector3<f32>, Vector3<f32>, div_v);
bench_binop!(_bench_vector4_div_v, Vector4<f32>, Vector4<f32>, div_v);
bench_binop_deref!(_bench_vector2_add_s, Vector2<f32>, f32, add_s)
bench_binop_deref!(_bench_vector3_add_s, Vector3<f32>, f32, add_s)
bench_binop_deref!(_bench_vector4_add_s, Vector4<f32>, f32, add_s)
bench_binop_deref!(_bench_vector2_add_s, Vector2<f32>, f32, add_s);
bench_binop_deref!(_bench_vector3_add_s, Vector3<f32>, f32, add_s);
bench_binop_deref!(_bench_vector4_add_s, Vector4<f32>, f32, add_s);
bench_binop_deref!(_bench_vector2_sub_s, Vector2<f32>, f32, sub_s)
bench_binop_deref!(_bench_vector3_sub_s, Vector3<f32>, f32, sub_s)
bench_binop_deref!(_bench_vector4_sub_s, Vector4<f32>, f32, sub_s)
bench_binop_deref!(_bench_vector2_sub_s, Vector2<f32>, f32, sub_s);
bench_binop_deref!(_bench_vector3_sub_s, Vector3<f32>, f32, sub_s);
bench_binop_deref!(_bench_vector4_sub_s, Vector4<f32>, f32, sub_s);
bench_binop_deref!(_bench_vector2_mul_s, Vector2<f32>, f32, mul_s)
bench_binop_deref!(_bench_vector3_mul_s, Vector3<f32>, f32, mul_s)
bench_binop_deref!(_bench_vector4_mul_s, Vector4<f32>, f32, mul_s)
bench_binop_deref!(_bench_vector2_mul_s, Vector2<f32>, f32, mul_s);
bench_binop_deref!(_bench_vector3_mul_s, Vector3<f32>, f32, mul_s);
bench_binop_deref!(_bench_vector4_mul_s, Vector4<f32>, f32, mul_s);
bench_binop_deref!(_bench_vector2_div_s, Vector2<f32>, f32, div_s)
bench_binop_deref!(_bench_vector3_div_s, Vector3<f32>, f32, div_s)
bench_binop_deref!(_bench_vector4_div_s, Vector4<f32>, f32, div_s)
bench_binop_deref!(_bench_vector2_div_s, Vector2<f32>, f32, div_s);
bench_binop_deref!(_bench_vector3_div_s, Vector3<f32>, f32, div_s);
bench_binop_deref!(_bench_vector4_div_s, Vector4<f32>, f32, div_s);
bench_binop!(_bench_vector2_dot, Vector2<f32>, Vector2<f32>, dot)
bench_binop!(_bench_vector3_dot, Vector3<f32>, Vector3<f32>, dot)
bench_binop!(_bench_vector4_dot, Vector4<f32>, Vector4<f32>, dot)
bench_binop!(_bench_vector2_dot, Vector2<f32>, Vector2<f32>, dot);
bench_binop!(_bench_vector3_dot, Vector3<f32>, Vector3<f32>, dot);
bench_binop!(_bench_vector4_dot, Vector4<f32>, Vector4<f32>, dot);
bench_binop!(_bench_vector3_cross, Vector3<f32>, Vector3<f32>, cross)
bench_binop!(_bench_vector3_cross, Vector3<f32>, Vector3<f32>, cross);
bench_unop!(_bench_vector2_norm, Vector2<f32>, length)
bench_unop!(_bench_vector3_norm, Vector3<f32>, length)
bench_unop!(_bench_vector4_norm, Vector4<f32>, length)
bench_unop!(_bench_vector2_norm, Vector2<f32>, length);
bench_unop!(_bench_vector3_norm, Vector3<f32>, length);
bench_unop!(_bench_vector4_norm, Vector4<f32>, length);
bench_unop!(_bench_vector2_normalize, Vector2<f32>, normalize)
bench_unop!(_bench_vector3_normalize, Vector3<f32>, normalize)
bench_unop!(_bench_vector4_normalize, Vector4<f32>, normalize)
bench_unop!(_bench_vector2_normalize, Vector2<f32>, normalize);
bench_unop!(_bench_vector3_normalize, Vector3<f32>, normalize);
bench_unop!(_bench_vector4_normalize, Vector4<f32>, normalize);