| 187 | // dimensions and indices using a very basic test |
| 188 | template<af_storage stype> |
| 189 | static void createFunction() { |
| 190 | af::array in = af::sparse(af::identity(3, 3), stype); |
| 191 | |
| 192 | af::array values = sparseGetValues(in); |
| 193 | af::array rowIdx = sparseGetRowIdx(in); |
| 194 | af::array colIdx = sparseGetColIdx(in); |
| 195 | dim_t nNZ = sparseGetNNZ(in); |
| 196 | |
| 197 | ASSERT_EQ(nNZ, values.elements()); |
| 198 | |
| 199 | ASSERT_EQ(0, af::max<double>(values - af::constant(1, nNZ))); |
| 200 | ASSERT_EQ(0, af::max<int>(rowIdx - |
| 201 | af::range(af::dim4(rowIdx.elements()), 0, s32))); |
| 202 | ASSERT_EQ(0, af::max<int>(colIdx - |
| 203 | af::range(af::dim4(colIdx.elements()), 0, s32))); |
| 204 | } |
| 205 | |
| 206 | template<typename Ti, typename To> |
| 207 | static void sparseCastTester(const int m, const int n, int factor) { |
nothing calls this directly
no test coverage detected