MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / sparseConvertTester

Function sparseConvertTester

test/sparse_convert.cpp:65–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64template<typename T, af_storage src, af_storage dest>
65void sparseConvertTester(const int m, const int n, int factor) {
66 SUPPORTED_TYPE_CHECK(T);
67
68 array A = cpu_randu<T>(dim4(m, n));
69
70 A = makeSparse<T>(A, factor);
71
72 // Create Sparse Array of type src and dest From Dense
73 array sA = sparse(A, src);
74
75 // Convert src to dest format and dest to src
76 array s2d = sparseConvertTo(sA, dest);
77
78 // Create the dest type from dense - gold
79 array dA = sparse(A, dest);
80
81 ASSERT_ARRAYS_EQ(dA, s2d);
82 ASSERT_ARRAYS_EQ(A, s2d);
83}
84
85#define CONVERT_TESTS_TYPES(T, STYPE, DTYPE, SUFFIX, M, N, F) \
86 TEST(SPARSE_CONVERT, T##_##STYPE##_##DTYPE##_##SUFFIX) { \

Callers

nothing calls this directly

Calls 3

sparseFunction · 0.85
sparseConvertToFunction · 0.85
dim4Class · 0.50

Tested by

no test coverage detected