| 53 | |
| 54 | template<typename T> |
| 55 | void ConstantCCheck(T value) { |
| 56 | SUPPORTED_TYPE_CHECK(T); |
| 57 | |
| 58 | const int num = 1000; |
| 59 | typedef typename dtype_traits<T>::base_type BT; |
| 60 | BT val(::real(value)); |
| 61 | dtype dty = (dtype)dtype_traits<T>::af_type; |
| 62 | af_array out; |
| 63 | dim_t dim[] = {(dim_t)num}; |
| 64 | ASSERT_SUCCESS(af_constant(&out, val, 1, dim, dty)); |
| 65 | |
| 66 | vector<T> h_in(num); |
| 67 | af_get_data_ptr(&h_in.front(), out); |
| 68 | |
| 69 | for (int i = 0; i < num; i++) { ASSERT_EQ(::real(h_in[i]), val); } |
| 70 | ASSERT_SUCCESS(af_release_array(out)); |
| 71 | } |
| 72 | |
| 73 | template<typename T> |
| 74 | void IdentityCPPCheck() { |
nothing calls this directly
no test coverage detected