MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / MatrixConversion

Class MatrixConversion

src/tests/test-conversion.cpp:51–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template <typename T>
51class MatrixConversion : public ::testing::Test
52{
53 using CLSE = ClSparseEnvironment;
54 using CSRE = CSREnvironment;
55
56public:
57 void SetUp()
58 {
59#if 0
60 // by default it is row_major;
61 cldenseInitMatrix(&A);
62
63 cl_int status;
64
65 A.values = ::clCreateBuffer(CLSE::context, CL_MEM_READ_WRITE,
66 CSRE::n_cols * CSRE::n_rows * sizeof(T),
67 nullptr, &status);
68 ASSERT_EQ(CL_SUCCESS, status);
69
70 A.num_cols = CSRE::n_cols;
71 A.num_rows = CSRE::n_rows;
72 A.lead_dim = std::min(A.num_cols, A.num_rows);
73#endif
74
75 }
76
77 void TearDown()
78 {
79#if 0
80 ::clReleaseMemObject(A.values);
81
82 cldenseInitMatrix(&A);
83#endif
84 }
85
86 // uBLAS dense matrix format type
87 typedef typename uBLAS::matrix<T, uBLAS::row_major, uBLAS::unbounded_array<T> > uBLASDenseM;
88
89 cldenseMatrix A;
90
91
92
93 void test_csr_to_dense()
94 {
95
96#if 1
97 // by default it is row_major;
98 cldenseInitMatrix(&A);
99
100 cl_int status;
101
102 A.values = ::clCreateBuffer(CLSE::context, CL_MEM_READ_WRITE,
103 CSRE::n_cols * CSRE::n_rows * sizeof(T),
104 nullptr, &status);
105 ASSERT_EQ(CL_SUCCESS, status);
106
107 A.num_cols = CSRE::n_cols;
108 A.num_rows = CSRE::n_rows;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected