| 874 | void TearDown() { releaseArrays(); } |
| 875 | |
| 876 | void setTestData(float* h_gold, dim4 gold_dims, float* h_in, dim4 in_dims, |
| 877 | float* h_pos, dim4 pos_dims) { |
| 878 | releaseArrays(); |
| 879 | |
| 880 | gold = 0; |
| 881 | in = 0; |
| 882 | pos = 0; |
| 883 | |
| 884 | this->gold_dims = gold_dims; |
| 885 | this->in_dims = in_dims; |
| 886 | this->pos_dims = pos_dims; |
| 887 | |
| 888 | for (int i = 0; i < gold_dims.elements(); ++i) { |
| 889 | h_gold_cast.push_back(static_cast<T>(h_gold[i])); |
| 890 | } |
| 891 | for (int i = 0; i < in_dims.elements(); ++i) { |
| 892 | h_in_cast.push_back(static_cast<T>(h_in[i])); |
| 893 | } |
| 894 | for (int i = 0; i < pos_dims.elements(); ++i) { |
| 895 | h_pos_cast.push_back(static_cast<BT>(h_pos[i])); |
| 896 | } |
| 897 | |
| 898 | ASSERT_SUCCESS(af_create_array(&gold, &h_gold_cast.front(), |
| 899 | gold_dims.ndims(), gold_dims.get(), |
| 900 | (af_dtype)dtype_traits<T>::af_type)); |
| 901 | ASSERT_SUCCESS(af_create_array(&in, &h_in_cast.front(), in_dims.ndims(), |
| 902 | in_dims.get(), |
| 903 | (af_dtype)dtype_traits<T>::af_type)); |
| 904 | ASSERT_SUCCESS(af_create_array(&pos, &h_pos_cast.front(), |
| 905 | pos_dims.ndims(), pos_dims.get(), |
| 906 | (af_dtype)dtype_traits<BT>::af_type)); |
| 907 | } |
| 908 | |
| 909 | void testSpclOutArray(TestOutputArrayType out_array_type) { |
| 910 | SUPPORTED_TYPE_CHECK(T); |
no test coverage detected