/**
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * This program is free software, you can redistribute it and/or modify it under the terms and conditions of 
 * CANN Open Software License Agreement Version 2.0 (the "License").
 * Please refer to the License for details. You may not use this file except in compliance with the License.
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
 * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
 * See LICENSE in the root of the software repository for the full text of the License.
 */

#ifndef AIR_TESTS_DEPENDS_LLM_DATADIST_SRC_HCCL_STUB_H_
#define AIR_TESTS_DEPENDS_LLM_DATADIST_SRC_HCCL_STUB_H_

#include "acl/acl.h"
#include "hccl_mem_comm.h"

HcclResult HcclExchangeMemDesc(HcclComm comm, uint32_t remoteRank, HcclMemDescs *local, int timeout,
                               HcclMemDescs *remote, uint32_t *actualNum) {
  for (uint32_t i = 0U; i < local->arrayLength; ++i) {
    strcpy(remote->array[i].desc, local->array[i].desc);
  }
  *actualNum = local->arrayLength;
  remote->arrayLength = local->arrayLength;
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclCommInitClusterInfoMemConfig(const char *cluster, uint32_t rank, HcclCommConfig *config, HcclComm *comm) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclCommDestroy(HcclComm comm) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclRemapRegistedMemory(HcclComm *comm, HcclMem *memInfoArray, uint64_t commSize, uint64_t arraySize) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclRegisterGlobalMem(HcclMem *mem, void **memHandle) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclDeregisterGlobalMem(void *memHandle) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclCommBindMem(HcclComm comm, void *memHandle) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclCommUnbindMem(HcclComm comm, void *memHandle) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclCommPrepare(HcclComm comm, HcclPrepareConfig *prepareConfig, int32_t timeout) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclBatchPut(HcclComm comm, uint32_t remoteRank, HcclOneSideOpDesc *desc, uint32_t descNum,
                        aclrtStream stream) {
  return HcclResult::HCCL_SUCCESS;
}

HcclResult HcclBatchGet(HcclComm comm, uint32_t remoteRank, HcclOneSideOpDesc *desc, uint32_t descNum,
                        aclrtStream stream) {
  return HcclResult::HCCL_SUCCESS;
}

#endif  // AIR_TESTS_DEPENDS_LLM_DATADIST_SRC_HCCL_STUB_H_