38 #include <pvsutil/Logger.h>
42 #include <SkelCL/IndexMatrix.h>
49 class IndexMatrixTest :
public ::testing::Test {
61 TEST_F(IndexMatrixTest, CreateIndexMatrix) {
64 EXPECT_EQ(256*32, mi.size().elemCount());
69 TEST_F(IndexMatrixTest, SimpleVoidMap) {
71 skelcl::Map<void(skelcl::IndexPoint)> map(R
"(
73 void func(IndexPoint ip, int_matrix_t out) { set(out, ip.y, ip.x, ip.y+ip.x); }
75 EXPECT_EQ(128*32, index.size().elemCount());
81 for (
size_t y = 0; y < m.size().rowCount(); ++y) {
82 for (
size_t x = 0; x < m.size().columnCount(); ++x) {
83 EXPECT_EQ(y+x, m[y][x]);
88 TEST_F(IndexMatrixTest, SimpleMap) {
89 skelcl::Map<int(skelcl::IndexPoint)> m(
"int func(IndexPoint i) { return i.y+i.x; }");
92 EXPECT_EQ(32*128, index.size().elemCount());
96 EXPECT_EQ(out.size().rowCount(), index.size().rowCount());
97 EXPECT_EQ(out.size().columnCount(), index.size().columnCount());
99 for (
size_t y = 0; y < out.size().rowCount(); ++y) {
100 for (
size_t x = 0; x < out.size().columnCount(); ++x) {
101 EXPECT_EQ(y+x, out[y][x]);
The Matrix class is a two dimensional container which makes its data accessible on the host as well a...
Out< ContainerType< T > > out(ContainerType< T > &c)
Helper function to create a Out wrapper object.
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...
SKELCL_DLL detail::DeviceProperties nDevices(size_t n)
Creates a detail::DeviceProperties object representing n devices. This object should be used as param...
SKELCL_DLL void terminate()
Frees all resources allocated internally by SkelCL.
This class defines an two-dimensional IndexPoint, i.e. a pair of unsigned integers representing a val...
The IndexMatrix (a.k.a. Matrix) class is a special implementation of a Matrix with Elemen...