Skip to content

Commit

Permalink
Remove unused vars (can access nullptr)
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanLaan committed Nov 6, 2023
1 parent 670dea2 commit 5b0742f
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions driver/xrt/src/accl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void ACCL::deinit() {
debug("Removing CCLO object at " + debug_hex(cclo->get_base_addr()));

cclo->printDebug();

CCLO::Options options{};
options.scenario = operation::config;
options.cfg_function = cfgFunc::reset_periph;
Expand Down Expand Up @@ -512,8 +512,6 @@ ACCLRequest *ACCL::scatter(BaseBuffer &sendbuf,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

bool is_root = communicator.local_rank() == root;
Expand Down Expand Up @@ -565,8 +563,6 @@ ACCLRequest *ACCL::gather(BaseBuffer &sendbuf,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

bool is_root = communicator.local_rank() == root;
Expand Down Expand Up @@ -627,8 +623,6 @@ ACCLRequest *ACCL::allgather(BaseBuffer &sendbuf,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

if (to_fpga == false && run_async == true) {
Expand Down Expand Up @@ -687,8 +681,6 @@ ACCLRequest *ACCL::reduce(BaseBuffer &sendbuf,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

bool is_root = communicator.local_rank() == root;
Expand Down Expand Up @@ -741,8 +733,6 @@ ACCLRequest *ACCL::reduce(dataType src_data_type,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(src_data_type) / 8);

const Communicator &communicator = communicators[comm_id];

bool is_root = communicator.local_rank() == root;
Expand Down Expand Up @@ -791,8 +781,6 @@ ACCLRequest *ACCL::reduce(BaseBuffer &sendbuf, dataType dst_data_type,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

if (count == 0) {
Expand Down Expand Up @@ -834,8 +822,6 @@ ACCLRequest *ACCL::reduce(dataType src_data_type, dataType dst_data_type,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(src_data_type) / 8);

const Communicator &communicator = communicators[comm_id];

if (count == 0) {
Expand Down Expand Up @@ -923,8 +909,6 @@ ACCLRequest *ACCL::reduce_scatter(BaseBuffer &sendbuf,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

if (to_fpga == false && run_async == true) {
Expand Down Expand Up @@ -972,8 +956,6 @@ ACCLRequest *ACCL::alltoall(BaseBuffer &sendbuf, BaseBuffer &recvbuf, unsigned i
dataType compress_dtype, bool run_async, std::vector<ACCLRequest *> waitfor){
CCLO::Options options{};

unsigned count_bytes = count * (dataTypeSize.at(sendbuf.type()) / 8);

const Communicator &communicator = communicators[comm_id];

if (to_fpga == false && run_async == true) {
Expand Down Expand Up @@ -1026,7 +1008,6 @@ ACCLRequest *ACCL::alltoall(BaseBuffer &sendbuf, BaseBuffer &recvbuf, unsigned i

}


void ACCL::barrier(communicatorId comm_id,
std::vector<ACCLRequest *> waitfor) {
CCLO::Options options{};
Expand Down Expand Up @@ -1163,7 +1144,7 @@ void ACCL::parse_hwid(){
}

void ACCL::initialize_accl(const std::vector<rank_t> &ranks, int local_rank,
int n_egr_rx_bufs, addr_t egr_rx_buf_size,
int n_egr_rx_bufs, addr_t egr_rx_buf_size,
addr_t max_egr_size, addr_t max_rndzv_size) {

parse_hwid();
Expand Down Expand Up @@ -1275,7 +1256,7 @@ void ACCL::setup_rendezvous_spare_buffers(addr_t rndzv_spare_buf_size, const std
buf = new SimBuffer(new int8_t[max_rndzv_msg_size](), max_rndzv_msg_size, dataType::int8,
static_cast<SimDevice *>(cclo)->get_context());
} else if(cclo->get_device_type() == CCLO::xrt_device ){
buf = new FPGABuffer<int8_t>(max_rndzv_msg_size, dataType::int8,
buf = new FPGABuffer<int8_t>(max_rndzv_msg_size, dataType::int8,
*(static_cast<FPGADevice *>(cclo)->get_device()), devicemem[i % devicemem.size()]);
} else if(cclo->get_device_type() == CCLO::coyote_device){
buf = new CoyoteBuffer<int8_t>(max_rndzv_msg_size, dataType::int8, static_cast<CoyoteDevice *>(cclo));
Expand Down Expand Up @@ -1368,7 +1349,6 @@ void ACCL::prepare_call(CCLO::Options &options) {
// if no compressed data type specified, set same as uncompressed
options.compression_flags = compressionFlags::NO_COMPRESSION;


if (dtypes.empty()) {
options.arithcfg_addr = 0x0;
return;
Expand Down Expand Up @@ -1513,7 +1493,6 @@ void ACCL::set_max_rendezvous_msg_size(unsigned int value) {
check_return_value("set_max_rendezvous_msg_size", handle);
}


void ACCL::configure_communicator(const std::vector<rank_t> &ranks,
int local_rank) {
if (eager_rx_buffers.empty()) {
Expand Down

0 comments on commit 5b0742f

Please sign in to comment.