@@ -40,20 +40,24 @@ TEST(tensor_test, test1)
4040 ASSERT_EQ (sum, n * (n + 1 ) / 2 );
4141}
4242
43- template <bool write, typename T> struct test_assign_ {
43+ template <bool write, typename T>
44+ struct test_assign_ {
4445 void operator ()(T &x, int v) { x = v; }
4546};
4647
47- template <typename T> struct test_assign_ <false , T> {
48+ template <typename T>
49+ struct test_assign_ <false , T> {
4850 void operator ()(T &x, int v) {}
4951};
5052
51- template <bool write, typename T> void test_assign (T &&x, int v)
53+ template <bool write, typename T>
54+ void test_assign (T &&x, int v)
5255{
5356 test_assign_<write, T>()(x, v);
5457}
5558
56- template <typename T, bool write = true > struct test_5d_array {
59+ template <typename T, bool write = true >
60+ struct test_5d_array {
5761 void operator ()(const T &t)
5862 {
5963 using R = typename T::value_type;
@@ -118,9 +122,13 @@ TEST(tensor_test, test3)
118122 test_5d_array<decltype (v), false >()(v);
119123}
120124
121- template <typename R, uint8_t r> void ref_func (const tensor_ref<R, r> &x) {}
125+ template <typename R, uint8_t r>
126+ void ref_func (const tensor_ref<R, r> &x)
127+ {
128+ }
122129
123- template <typename R, uint8_t r> void test_auto_ref ()
130+ template <typename R, uint8_t r>
131+ void test_auto_ref ()
124132{
125133 static_assert (std::is_convertible<tensor<R, r>, tensor_ref<R, r>>::value,
126134 " can't convert to ref" );
@@ -142,9 +150,13 @@ TEST(tensor_test, auto_ref)
142150 // f(t); // NOT possible
143151}
144152
145- template <typename R, uint8_t r> void view_func (const tensor_view<R, r> &x) {}
153+ template <typename R, uint8_t r>
154+ void view_func (const tensor_view<R, r> &x)
155+ {
156+ }
146157
147- template <typename R, uint8_t r> void test_auto_view ()
158+ template <typename R, uint8_t r>
159+ void test_auto_view ()
148160{
149161 static_assert (std::is_convertible<tensor<R, r>, tensor_view<R, r>>::value,
150162 " can't convert to view" );
@@ -177,7 +189,8 @@ auto create_tensor_func()
177189
178190TEST (tensor_test, return_tensor) { auto t = create_tensor_func (); }
179191
180- template <typename R> R read_tensor_func (const tensor<R, 2 > &t, int i, int j)
192+ template <typename R>
193+ R read_tensor_func (const tensor<R, 2 > &t, int i, int j)
181194{
182195 const R x = t.at (i, j);
183196 return x;
@@ -256,6 +269,8 @@ void test_static_properties(const ttl::internal::basic_tensor<R, S, D, A> &x)
256269 using T = ttl::internal::basic_tensor<R, S, D, A>;
257270 static_assert (std::is_same<typename T::value_type, R>::value,
258271 " invalid value_type" );
272+ static_assert (std::is_same<typename T::device_type, D>::value,
273+ " invalid device_type" );
259274 static_assert (T::rank == r, " invalid rank" );
260275 auto x_shape = x.shape ();
261276 static_assert (decltype (x_shape)::rank == r, " invalid rank of shape" );
@@ -316,7 +331,8 @@ TEST(tensor_test, test_const_properties)
316331 " " );
317332}
318333
319- template <typename T> void test_slice_57_52_53_slice_19_38 (const T &t)
334+ template <typename T>
335+ void test_slice_57_52_53_slice_19_38 (const T &t)
320336{
321337 const auto t1 = t.slice (0 , 19 );
322338 const auto t2 = t.slice (19 , 57 );
@@ -349,7 +365,8 @@ TEST(tensor_test, test_slice)
349365 }
350366}
351367
352- template <typename T> void test_data_end (const T &t)
368+ template <typename T>
369+ void test_data_end (const T &t)
353370{
354371 ASSERT_EQ (t.data_end (), t.data () + t.shape ().size ());
355372 {
@@ -359,7 +376,8 @@ template <typename T> void test_data_end(const T &t)
359376 }
360377}
361378
362- template <typename R> void test_data_end_all ()
379+ template <typename R>
380+ void test_data_end_all ()
363381{
364382 // using ttl::experimental::raw_ref;
365383 // using ttl::experimental::raw_view;
0 commit comments