38 #include <pvsutil/Logger.h>
42 #include <SkelCL/Matrix.h>
48 class MatrixTest :
public ::testing::Test {
51 pvsutil::defaultLogger.setLoggingLevel(pvsutil::Logger::Severity::Debug);
60 TEST_F(MatrixTest, CreateEmptyMatrix) {
63 EXPECT_TRUE(mi.empty());
67 TEST_F(MatrixTest, CreateMatrix) {
70 EXPECT_FALSE(mi.empty());
72 EXPECT_EQ(0, *mi.begin());
73 for (
size_t i = 0; i < 10; ++i) {
74 for (
size_t j = 0; j < 10; ++j) {
75 EXPECT_EQ(0.0, mi({i,j}));
80 TEST_F(MatrixTest, CreateMatrixFrom2DVector) {
81 std::vector<std::vector<int> > vec(10);
82 for (
unsigned int i = 0; i < 10; ++i) {
84 for (
unsigned int j = 0; j < 10; ++j) {
91 EXPECT_FALSE(mi.empty());
93 for (
size_t i = 0; i < 10; ++i) {
94 for (
size_t j = 0; j < 10; ++j) {
95 EXPECT_EQ(i*j, mi[i][j]);
The Matrix class is a two dimensional container which makes its data accessible on the host as well a...
SKELCL_DLL void init(detail::DeviceProperties properties=allDevices())
Initializes the SkelCL library. This function (or another init function) has to be called prior to ev...
size_type elemCount() const
Returns the total number of elements. I.e. rowCount() * columnCount().
SKELCL_DLL detail::DeviceProperties nDevices(size_t n)
Creates a detail::DeviceProperties object representing n devices. This object should be used as param...
This class defines a two dimensional size for a Matrix.
SKELCL_DLL void terminate()
Frees all resources allocated internally by SkelCL.
static Matrix< T > from2DVector(const std::vector< std::vector< T >> &matrix, const detail::Distribution< Matrix< T >> &distribution=detail::Distribution< Matrix< T >>())
static function creating a matrix from 2 dim std::vector as parameter