CCLO

ACCL::CCLO

class CCLO

Abstract class that defines operations to be performed on the CCLO on the FPGA.

Subclassed by ACCL::FPGADevice, ACCL::SimDevice

Public Functions

inline CCLO()

Construct a new CCLO object.

virtual void call(const Options &options) = 0

Call a CCLO operation based on the options.

Parameters

options – Specifies CCLO operation and configuration.

virtual void start(const Options &options) = 0

Call a CCLO operation based on the options, and wait for operation to complete.

Parameters

options – Specifies CCLO operation and configuration.

virtual val_t read(addr_t offset) = 0

Read data from FPGA at specified address.

Parameters

offset – Offset to read data from on the FPGA.

Returns

val_t Data located at specified address on FPGA.

virtual void write(addr_t offset, val_t val) = 0

Write data to specified address on FPGA.

Parameters
  • offset – Offset to write data to on the FPGA.

  • val – Value to write at specified address on FPGA.

virtual void wait() = 0

Wait for CCLO operation to complete.

virtual addr_t get_base_addr() = 0

Get the base address of the CCLO, this currently returns 0x0 on hardware.

Returns

addr_t The base address of the CCLO.

struct Options

CCLO options for call and start.

Public Functions

inline Options()

Construct a new CCLO Options object with default parameters.

Public Members

operation scenario

Operation to perform on CCLO.

unsigned int count

Amount of elements to perform operation on.

unsigned int comm

Address of communicator to use.

unsigned int root_src_dst

Rank to use as root for the operation.

cfgFunc cfg_function

Configuration function to use for operation.

reduceFunction reduce_function

Reduce function to use for operation.

unsigned int tag

Tag to use for send or receive.

addr_t arithcfg_addr

Address of the arithmetic configuration to use.

dataType compress_dtype

Compress buffers to this datatype.

compressionFlags compression_flags

Compression configuration.

streamFlags stream_flags

Stream configuration.

BaseBuffer *addr_0

ACCL buffer of operand 0.

BaseBuffer *addr_1

ACCL buffer of operand 1.

BaseBuffer *addr_2

ACCL buffer of result.

std::vector<CCLO*> waitfor

Wait for these operations to complete; currently unsupported.

ACCL::ArithConfig

class ArithConfig

Arithmetic configuration needed for CCLO.

Public Functions

inline ArithConfig(unsigned int uncompressed_elem_bytes, unsigned int compressed_elem_bytes, unsigned int elem_ratio_log, unsigned int compressor_tdest, unsigned int decompressor_tdest, bool arith_is_compressed, std::vector<unsigned int> arith_tdest)

Construct a new Arithmetic Configuration object.

Parameters
  • uncompressed_elem_bytes – Size of uncompressed datatype.

  • compressed_elem_bytes – Size of compressed datatype.

  • elem_ratio_log – Element ratio log of datatype compression.

  • compressor_tdest – Type destination for compression in compression kernel. 0 for dataType::float32 to dataType::float16 in default ACCL kernel.

  • decompressor_tdest – Type destination for decompression in compression kernel. 1 for dataType::float16 to dataType::float32 in default ACCL kernel.

  • arith_is_compressed – Boolean to determine if arithmetic should be performed on the compressed or uncompressed datatypes.

  • arith_tdest – Type destination for arithmetic in arithmetic kernels. 0 for dataType::float32, 1 for dataType::float64, 2 for dataType::int32, 3 for dataType::int64, and 4 for dataType::float16 in default ACCL kernel.

inline void set_exchmem(addr_t address)

Set the exchange memory address to the specified address.

Parameters

address – The address to set the exchange memory to

inline addr_t addr() const

Get the address on the FPGA where the arithmetic configuration is stored.

Returns

addr_t Address on the FPGA where the arithmetic configuration is stored.

ACCL::FPGADevice

class FPGADevice : public ACCL::CCLO

Implementation of CCLO that uses a CCLO kernel on a FPGA.

Public Functions

FPGADevice(xrt::ip &cclo_ip, xrt::kernel &hostctrl_ip)

Construct a new FPGADevice object.

Parameters
  • cclo_ip – The CCLO kernel to use.

  • hostctrl_ip – The hostctrl kernel to use.

inline virtual ~FPGADevice()

Destroy the FPGADevice object.

virtual void call(const Options &options) override

Call a CCLO operation based on the options.

Parameters

options – Specifies CCLO operation and configuration.

virtual void start(const Options &options) override

Call a CCLO operation based on the options, and wait for operation to complete.

Parameters

options – Specifies CCLO operation and configuration.

virtual val_t read(addr_t offset) override

Read data from FPGA at specified address.

Parameters

offset – Offset to read data from on the FPGA.

Returns

val_t Data located at specified address on FPGA.

virtual void write(addr_t offset, val_t val) override

Write data to specified address on FPGA.

Parameters
  • offset – Offset to write data to on the FPGA.

  • val – Value to write at specified address on FPGA.

virtual void wait() override

Wait for CCLO operation to complete.

inline virtual addr_t get_base_addr() override

Get the base address of the CCLO, this currently returns 0x0 on hardware.

Returns

addr_t The base address of the CCLO.

ACCL::SimDevice

class SimDevice : public ACCL::CCLO

Implementation of CCLO that uses an external CCLO simulator or emulator.

Public Functions

SimDevice(unsigned int zmqport, unsigned int local_rank)

Construct a new Simulated Device object.

Parameters
  • zmqport – Port of simulator or emulator to connect to.

  • local_rank – The local rank of this process.

inline virtual ~SimDevice()

Destroy the Simulated Device object.

virtual void call(const Options &options) override

Call a CCLO operation based on the options.

Parameters

options – Specifies CCLO operation and configuration.

virtual void start(const Options &options) override

Call a CCLO operation based on the options, and wait for operation to complete.

Parameters

options – Specifies CCLO operation and configuration.

virtual val_t read(addr_t offset) override

Read data from FPGA at specified address.

Parameters

offset – Offset to read data from on the FPGA.

Returns

val_t Data located at specified address on FPGA.

virtual void write(addr_t offset, val_t val) override

Write data to specified address on FPGA.

Parameters
  • offset – Offset to write data to on the FPGA.

  • val – Value to write at specified address on FPGA.

virtual void wait() override

Wait for CCLO operation to complete.

inline virtual addr_t get_base_addr() override

Get the base address of the CCLO, this currently returns 0x0 on hardware.

Returns

addr_t The base address of the CCLO.

inline zmq_intf_context *get_context()

Get the zmq server used by the CCLO emulator or simulator.

Returns

zmq_intf_context* The zmq server used by the CCLO.