Files
triton/include/isaac/types.h

46 lines
855 B
C
Raw Normal View History

#ifndef ISAAC_TYPES_H
#define ISAAC_TYPES_H
2015-02-01 23:56:05 -05:00
#include <list>
#include <cstddef>
#include "isaac/defines.h"
namespace isaac
{
typedef long long int_t;
2015-01-18 14:52:45 -05:00
struct ISAACAPI size4
2015-01-18 14:52:45 -05:00
{
size4(int_t s0, int_t s1 = 1, int_t s2 = 1, int_t s3 = 1)
{
data_[0] = s0;
data_[1] = s1;
data_[2] = s2;
data_[3] = s3;
}
bool operator==(size4 const & other) const { return (*this)[0]==other[0] && (*this)[1]==other[1]; }
int_t operator[](size_t i) const { return data_[i]; }
int_t & operator[](size_t i) { return data_[i]; }
private:
int_t data_[4];
2015-01-18 14:52:45 -05:00
};
inline int_t prod(size4 const & s) { return s[0]*s[1]; }
2015-01-18 14:52:45 -05:00
struct slice
{
slice(int_t _start, int_t _end, int_t _stride = 1) : start(_start), size((_end - _start)/_stride), stride(_stride) { }
int_t start;
int_t size;
int_t stride;
};
typedef slice _;
2015-02-04 22:06:15 -05:00
class array_base{ };
}
#endif