Exemplo n.º 1
0
 HDINLINE
 TCursor operator()(const TCursor& cursor, const math::Int<2>& jump) const
 {
     math::Int<2> twistedJump;
     twistedJump[Axes::x::value] = jump.x();
     twistedJump[Axes::y::value] = jump.y();
     return cursor(twistedJump);
 }
Exemplo n.º 2
0
 HDINLINE
 Data operator()(const Data& data, const math::Int<dim>& jump) const
 {
     char* result = (char*)data;
     result += jump.x() * sizeof(typename boost::remove_pointer<Data>::type)
            + jump.y() * Pitch::x::value;
     return (Data)result;
 }
Exemplo n.º 3
0
 HDINLINE
 math::Int<3> operator()(const math::Int<2>& _blockIdx,
                           const math::Int<3>& _threadIdx) const
 {
     return math::Int<3>(
         (_blockIdx.x() % this->widthInBlocks),
         _blockIdx.y(),
         (_blockIdx.x() / this->widthInBlocks)) * (math::Int<3>)BlockDim().vec() + _threadIdx;
 }
Exemplo n.º 4
0
 HDINLINE Data
 operator()(const Data& data, const math::Int<dim>& jump) const
 {
     char* result = (char*)data;
     result += jump.x() * sizeof(typename boost::remove_pointer<Data>::type);
     for(int i = 1; i < dim; i++)
         result += jump[i] * this->pitch[i-1];
     return (Data)result;
 }
Exemplo n.º 5
0
 HDINLINE
 math::Int<1> operator()(const math::Int<1>& _blockIdx,
                           const math::Int<1>& _threadIdx) const
 {
     return _blockIdx.x() * BlockDim::x::value + _threadIdx.x();
 }
Exemplo n.º 6
0
 inline Plotter& operator=(const math::Float<3>& color)
 {
     png.plot(pos.x()+1, pos.y()+1, (double)color.x(), (double)color.y(), (double)color.z());
     return *this;
 }