Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej committed Jul 19, 2023
1 parent cdcb83f commit 6812bda
Showing 1 changed file with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions lib/Targets/AIETargetXAIEV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace xilinx {
namespace AIE {

// This string is output at the top of the lowered C code.
<<<<<<< HEAD
const char xaie_c_file_header[] = R"code(
// This file was auto-generated by aiecc.py --aie-generate-xaie.
Expand All @@ -59,28 +58,16 @@ const char xaie_c_file_header[] = R"code(
} \
} while(0)
static XAie_DmaDimDesc *__mlir_aie_alloc_dim_desc(size_t ndims) {
XAie_DmaDimDesc *ret = NULL;
ret = (XAie_DmaDimDesc *)calloc(sizeof(XAie_DmaDimDesc), ndims);
if(NULL == ret) {
__mlir_aie_verbose(fprintf(stderr, "Allocating DmaDimDesc failed.\n"));
}
return ret;
}
)code";
=======
const char xaie_c_file_header[] =
"#ifndef MLIR_AIE_QUIET\n"
"#define __mlir_aie_print(x) x\n"
"#else\n"
"#define __mlir_aie_print(x)\n"
"#endif\n"
"#define __mlir_aie_try(x) do { AieRC ret = (x); if(ret != XAIE_OK) { "
"__mlir_aie_print(fprintf(stderr, #x \"failed: %d\\n\", x)); return x; } "
"} while(0)\n"
"\n"
"static XAie_DmaDimDesc *__mlir_aie_alloc_dim_desc(size_t ndims) { \n"
" XAie_DmaDimDesc *ret = NULL;\n"
" ret = (XAie_DmaDimDesc *)calloc(sizeof(XAie_DmaDimDesc), ndims);\n"
" if(NULL == ret) { \n"
" __mlir_aie_print(fprintf(stderr, \n"
" \"Allocating DmaDimDesc failed.\\n\"));\n"
" }\n"
" return ret;\n"
"}\n";
>>>>>>> cbc2aa0 (initial draft of N-dimensional buffer descriptors for AIE-ML)

/*
static std::string shimDMAInstStr(StringRef col, StringRef index) {
Expand Down Expand Up @@ -310,7 +297,7 @@ mlir::LogicalResult generateDMAConfig(OpType memOp, raw_ostream &output,
"__mlir_aie_alloc_dim_desc("
<< std::to_string(ndims) << ");\n";
output << "if(NULL == " << tensor << ".Dim){\n"
<< " return XAIE_ERR;\n"
<< " return 1;\n"
<< "}\n";
for(int i = 0; i < ndims; i++) {
// Assume AIE-ML architecture; we assert this above
Expand Down Expand Up @@ -953,14 +940,14 @@ mlir::LogicalResult AIETranslateToXAIEV2(ModuleOp module, raw_ostream &output) {
if (!lock.hasName())
return;
std::string lockName(lock.name().getValue());
output << "AieRC mlir_aie_acquire_" << lockName << "(" << ctx_p
output << "int mlir_aie_acquire_" << lockName << "(" << ctx_p
<< ", int value, int timeout) {\n";
output << " const int id = " << lock.getLockIDValue() << ";\n";
output << " return XAie_LockAcquire(" << deviceInstRef << ", "
<< tileLocStr(col, row) << ", " << tileLockStr("id", "value")
<< ", timeout);\n";
output << "}\n";
output << "AieRC mlir_aie_release_" << lockName << "(" << ctx_p
output << "int mlir_aie_release_" << lockName << "(" << ctx_p
<< ", int value, int timeout) {\n";
output << " const int id = " << lock.getLockIDValue() << ";\n";
output << " return XAie_LockRelease(" << deviceInstRef << ", "
Expand Down

0 comments on commit 6812bda

Please sign in to comment.