Poplar and PopLibs
gcl::Chunk Struct Reference

Represents a section of a tensor mapped to an IPU. More...

#include <Collectives.hpp>

Public Member Functions

 Chunk (const Chunk &)=default
 Defaulted to avoid warnings in deprecation period.
 
 Chunk (Chunk &&) noexcept=default
 Defaulted to avoid warnings in deprecation period.
 
Chunkoperator= (const Chunk &)=default
 Defaulted to avoid warnings in deprecation period. More...
 
Chunkoperator= (Chunk &&) noexcept=default
 Defaulted to avoid warnings in deprecation period. More...
 
 Chunk (poplar::Tensor tensor, unsigned index, unsigned offset)
 A section of a tensor mapped to an IPU. More...
 
poplar::Tensor getTensor () const
 Mapped tensor. More...
 
unsigned getIndex () const
 Ring index (data parallel index) More...
 
unsigned getOffset () const
 Offset within rank (model parallel index. More...
 
void setTensor (poplar::Tensor tensor)
 Set mapped tensor. More...
 
void setIndex (unsigned index)
 Set ring index. More...
 
void setOffset (unsigned offset)
 Set offset. More...
 

Public Attributes

poplar::Tensor tensor
 Mapped tensor.
 
unsigned index = 0
 Ring index (data parallel index)
 
unsigned offset = 0
 Offset within rank (model parallel index.
 

Detailed Description

Represents a section of a tensor mapped to an IPU.

Constructor & Destructor Documentation

◆ Chunk()

gcl::Chunk::Chunk ( poplar::Tensor  tensor,
unsigned  index,
unsigned  offset 
)

A section of a tensor mapped to an IPU.

Parameters
tensorMapped tensor
indexRing index (data parallel index)
offsetOffset within rank (model parallel index)

Member Function Documentation

◆ getIndex()

unsigned gcl::Chunk::getIndex ( ) const

Ring index (data parallel index)

Returns
index

◆ getOffset()

unsigned gcl::Chunk::getOffset ( ) const

Offset within rank (model parallel index.

Returns
offset

◆ getTensor()

poplar::Tensor gcl::Chunk::getTensor ( ) const

Mapped tensor.

Returns
mapped tensor

◆ operator=() [1/2]

Chunk & gcl::Chunk::operator= ( Chunk &&  )
defaultnoexcept

Defaulted to avoid warnings in deprecation period.

Returns
The Chunk being assigned to

◆ operator=() [2/2]

Chunk & gcl::Chunk::operator= ( const Chunk )
default

Defaulted to avoid warnings in deprecation period.

Returns
The Chunk being assigned to

◆ setIndex()

void gcl::Chunk::setIndex ( unsigned  index)

Set ring index.

Parameters
indexring index

◆ setOffset()

void gcl::Chunk::setOffset ( unsigned  offset)

Set offset.

Parameters
offsetoffset within rank

◆ setTensor()

void gcl::Chunk::setTensor ( poplar::Tensor  tensor)

Set mapped tensor.

Parameters
tensormapped tensor

The documentation for this struct was generated from the following file: