CCLO

ACCL::CCLO

class CCLO

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

Subclassed by ACCL::CoyoteDevice, ACCL::SimDevice, ACCL::XRTDevice

Public Functions

inline CCLO()

Construct a new CCLO object.

virtual ACCLRequest *call(const Options &options) = 0

Call a CCLO operation based on the options.

Parameters:

options – Specifies CCLO operation and configuration.

Returns:

ACCLRequest* Request associated to the call. Internal use only on sync calls;

virtual ACCLRequest *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.

Returns:

ACCLRequest* Request associated to the call.

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(ACCLRequest *request) = 0

Wait for CCLO operation associated with the request to complete.

Parameters:

request – Request to wait for

virtual timeoutStatus wait(ACCLRequest *request, std::chrono::milliseconds timeout) = 0

Wait for CCLO operation associated to the given request to complete.

Note that the timeout is currently ignored when using the simulator.

Parameters:
  • request – Request to wait for

  • timeout – Time out wait after this many milliseconds have passed.

Returns:

timeoutStatus Status on whether the wait was timed out or not.

virtual bool test(ACCLRequest *request) = 0

Tests if the given request completed.

Parameters:

request – Request to wait for

Returns:

true If the request was completed

Returns:

false If the request did not complete

virtual void free_request(ACCLRequest *request) = 0

Free given request.

Parameters:

request – Request to be freed

virtual val_t get_retcode(ACCLRequest *request) = 0

Gets the return code of a given request.

Parameters:

request – Request to be look up

virtual uint64_t get_duration(ACCLRequest *request) = 0

Gets the duration of a given request in nanoseconds.

Parameters:

request – Request to be look up

Returns:

uint64_t The duration in nanoseconds.

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.

virtual deviceType get_device_type() = 0

Get the device type.

Returns:

deviceType Whether this is a sim device, xrt device or coyote device.

virtual void printDebug() = 0

printDebug.

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.

hostFlags host_flags

Indicate which buffers are host-only.

BaseBuffer *addr_0

ACCL buffer of operand 0.

BaseBuffer *addr_1

ACCL buffer of operand 1.

BaseBuffer *addr_2

ACCL buffer of result.

dataType data_type_io_0

Data type of ACCL input or output from stream.

dataType data_type_io_1

Data type of ACCL input or output from stream.

dataType data_type_io_2

Data type of ACCL input or output from stream.

std::vector<ACCLRequest*> 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::XRTDevice

class XRTDevice : public ACCL::CCLO

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

Public Functions

XRTDevice(xrt::ip &cclo_ip, xrt::kernel &hostctrl_ip, xrt::device &device)

Construct a new XRTDevice object.

Parameters:
  • cclo_ip – The CCLO kernel to use.

  • hostctrl_ip – The hostctrl kernel to use.

  • device – Xrt device;

inline virtual ~XRTDevice()

Destroy the XRTDevice object.

virtual ACCLRequest *call(const Options &options) override

Call a CCLO operation based on the options.

Parameters:

options – Specifies CCLO operation and configuration.

Returns:

ACCLRequest* Request associated to the call. Internal use only on sync calls;

virtual ACCLRequest *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.

Returns:

ACCLRequest* Request associated to the call.

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(ACCLRequest *request) override

Wait for CCLO operation associated with the request to complete.

Parameters:

request – Request to wait for

virtual timeoutStatus wait(ACCLRequest *request, std::chrono::milliseconds timeout) override

Wait for CCLO operation associated to the given request to complete.

Note that the timeout is currently ignored when using the simulator.

Parameters:
  • request – Request to wait for

  • timeout – Time out wait after this many milliseconds have passed.

Returns:

timeoutStatus Status on whether the wait was timed out or not.

virtual bool test(ACCLRequest *request) override

Tests if the given request completed.

Parameters:

request – Request to wait for

Returns:

true If the request was completed

Returns:

false If the request did not complete

virtual uint64_t get_duration(ACCLRequest *request)

Gets the duration of a given request in nanoseconds.

Parameters:

request – Request to be look up

Returns:

uint64_t The duration in nanoseconds.

virtual void free_request(ACCLRequest *request) override

Free given request.

Parameters:

request – Request to be freed

virtual val_t get_retcode(ACCLRequest *request) override

Gets the return code of a given request.

Parameters:

request – Request to be look up

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.

void complete_request(FPGARequest *request)

Internally completes the request.

Parameters:

request – Associated request to be completed

virtual deviceType get_device_type() override

Get the device type.

Returns:

deviceType Whether this is a sim device, xrt device or coyote device.

inline virtual void printDebug() override

printDebug.

ACCL::CoyoteDevice

class CoyoteDevice : public ACCL::CCLO

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

Public Functions

~CoyoteDevice()

Destroy the CoyoteDevice object.

virtual ACCLRequest *call(const Options &options) override

Call a CCLO operation based on the options.

Parameters:

options – Specifies CCLO operation and configuration.

Returns:

ACCLRequest* Request associated to the call. Internal use only on sync calls;

virtual ACCLRequest *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.

Returns:

ACCLRequest* Request associated to the call.

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(ACCLRequest *request) override

Wait for CCLO operation associated with the request to complete.

Parameters:

request – Request to wait for

virtual timeoutStatus wait(ACCLRequest *request, std::chrono::milliseconds timeout) override

Wait for CCLO operation associated to the given request to complete.

Note that the timeout is currently ignored when using the simulator.

Parameters:
  • request – Request to wait for

  • timeout – Time out wait after this many milliseconds have passed.

Returns:

timeoutStatus Status on whether the wait was timed out or not.

void complete_request(CoyoteRequest *request)

Internally completes the request.

Parameters:

request – Associated request to be completed

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.

virtual deviceType get_device_type() override

Get the device type.

Returns:

deviceType Whether this is a sim device, xrt device or coyote device.

virtual void printDebug() override

printDebug.

virtual bool test(ACCLRequest *request) override

Tests if the given request completed.

Parameters:

request – Request to wait for

Returns:

true If the request was completed

Returns:

false If the request did not complete

virtual uint64_t get_duration(ACCLRequest *request)

Gets the duration of a given request in nanoseconds.

Parameters:

request – Request to be look up

Returns:

uint64_t The duration in nanoseconds.

virtual void free_request(ACCLRequest *request) override

Free given request.

Parameters:

request – Request to be freed

virtual val_t get_retcode(ACCLRequest *request) override

Gets the return code of a given request.

Parameters:

request – Request to be look up

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 ACCLRequest *call(const Options &options) override

Call a CCLO operation based on the options.

Parameters:

options – Specifies CCLO operation and configuration.

Returns:

ACCLRequest* Request associated to the call. Internal use only on sync calls;

virtual ACCLRequest *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.

Returns:

ACCLRequest* Request associated to the call.

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(ACCLRequest *request) override

Wait for CCLO operation associated with the request to complete.

Parameters:

request – Request to wait for

virtual timeoutStatus wait(ACCLRequest *request, std::chrono::milliseconds timeout) override

Wait for CCLO operation associated to the given request to complete.

Note that the timeout is currently ignored when using the simulator.

Parameters:
  • request – Request to wait for

  • timeout – Time out wait after this many milliseconds have passed.

Returns:

timeoutStatus Status on whether the wait was timed out or not.

virtual bool test(ACCLRequest *request) override

Tests if the given request completed.

Parameters:

request – Request to wait for

Returns:

true If the request was completed

Returns:

false If the request did not complete

virtual uint64_t get_duration(ACCLRequest *request) override

Gets the duration of a given request in nanoseconds.

Parameters:

request – Request to be look up

Returns:

uint64_t The duration in nanoseconds.

virtual void free_request(ACCLRequest *request) override

Free given request.

Parameters:

request – Request to be freed

virtual val_t get_retcode(ACCLRequest *request) override

Gets the return code of a given request.

Parameters:

request – Request to be look up

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 virtual void printDebug() override

printDebug.

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.

void complete_request(SimRequest *request)

Internally completes the request.

Parameters:

request – Associated request to be completed

virtual deviceType get_device_type() override

Get the device type.

Returns:

deviceType Whether this is a sim device, xrt device or coyote device.