commit for save

This commit is contained in:
wanghailu 2023-08-07 17:26:16 +08:00
parent 57ac94d893
commit 0699ffbd13
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
#pragma once
#include "cnrt.h"
#include <string>
namespace infini {
class BangGenCode {
private:
int64_t nram_size = 589824;
public:
std::string genHead() {
std::string temp = "#include <bang.h>\n";
temp += "#define NRAM_SIZE " + std::to_string(nram_size) + "\n";
return temp;
}
std::string genNramSplit(int64_t num) {
int64_t deal_size = nram_size / (num + 1);
int64_t deal_size_align = ((deal_size) / (64) * (64));
std::string temp = "";
for(int64_t i = 0; i < num; ++i) {
temp += "__nram__ char nram_buffer" + std::to_string(i) + "[" + std::to_string(deal_size_align) + "]\n";
}
temp += "__nram__ char nram_buffer_output[" + std::to_string(deal_size_align) + "]\n";
}
return temp;
std::string genElementwiseFusion() {
}
}
}