dsa-scheduler's People
dsa-scheduler's Issues
Make error for dsa-<source-name>.bc
SBCONFIG=/root/ajis01/framework/dsa-framework/spatial.json
opt -load /root/ajis01/framework/dsa-framework/dsa-llvm-project/build/lib/DSAPass.so
-stream-specialize accumulate_try.bc -o dsa-accumulate_try.bc
Segmentation fault
[Warning] To hide the latency -1, 8 elements are active
This requires a 9-deep FIFO buffer
[CHECK FAIL] /root/ajis01/framework/dsa-framework/spatial-scheduler/src/insts/ssinst.cpp:2442: false Unknown inst
terminate called without an active exception
Aborted
Both operands to a binary operator are not of the same type!
%48 = add i32 %47, i64 1
Both operands to a binary operator are not of the same type!
%49 = sub i32 %48, i64 1
Both operands to a binary operator are not of the same type!
%50 = sdiv i32 %49, i64 8
Both operands to a binary operator are not of the same type!
%51 = add i32 %50, i64 1
Both operands to a binary operator are not of the same type!
%52 = mul i32 %51, i64 1
in function _Z15accumulate_cgraPKfiiiiPfiiii
LLVM ERROR: Broken function found, compilation aborted!
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: opt -load /root/ajis01/framework/dsa-framework/dsa-llvm-project/build/lib/DSAPass.so -stream-specialize accumulate_try.bc -o dsa-accumulate_try.bc
- Running pass 'Function Pass Manager' on module 'accumulate_try.bc'.
- Running pass 'Module Verifier' on function '@_Z15accumulate_cgraPKfiiiiPfiiii'
#0 0x00007fc56c1a4e1c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMSupport.so.12git+0x1a1e1c)
#1 0x00007fc56c1a2c74 llvm::sys::RunSignalHandlers() (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMSupport.so.12git+0x19fc74)
#2 0x00007fc56c1a2dc3 SignalHandler(int) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMSupport.so.12git+0x19fdc3)
#3 0x00007fc56b8c8040 (/lib/x86_64-linux-gnu/libc.so.6+0x3f040)
#4 0x00007fc56b8c7fb7 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3efb7)
#5 0x00007fc56b8c9921 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40921)
#6 0x00007fc56c0d85c6 llvm::report_fatal_error(llvm::Twine const&, bool) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMSupport.so.12git+0xd55c6)
#7 0x00007fc56c0d86f8 (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMSupport.so.12git+0xd56f8)
#8 0x00007fc56c65d2ff (anonymous namespace)::VerifierLegacyPass::runOnFunction(llvm::Function&) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMCore.so.12git+0x2662ff)
#9 0x00007fc56c5d6c27 llvm::FPPassManager::runOnFunction(llvm::Function&) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMCore.so.12git+0x1dfc27)
#10 0x00007fc56c5d7341 llvm::FPPassManager::runOnModule(llvm::Module&) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMCore.so.12git+0x1e0341)
#11 0x00007fc56c5d5f9f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/root/ajis01/framework/dsa-framework/ss-tools/lib/libLLVMCore.so.12git+0x1def9f)
#12 0x0000560276291f14 main (/root/ajis01/framework/dsa-framework/ss-tools/bin/opt+0x1ef14)
#13 0x00007fc56b8aabf7 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf7)
#14 0x00005602762927ba _start (/root/ajis01/framework/dsa-framework/ss-tools/bin/opt+0x1f7ba)
Aborted
../../common/Makefile.compile:26: recipe for target 'dsa-accumulate_try.bc' failed
make: *** [dsa-accumulate_try.bc] Error 134
For the following source code
`
#include "sim_timing.h"
#include "string.h"
#include "errno.h"
#include "assert.h"
#include
#include
#include
//#include <opencv2/highgui.hpp>
//#include<opencv2/imgproc.hpp>
#define TYPE float
#define CACHE_WARMUP 1
#undef N
//Algorithm Parameters
#define row_size 585
//#define col_size 1024
#define col_size 1087
//#define row_size 16
//#define col_size 33
#define N row_sizecol_size
#define NN NN
#define C 1
#define block_size 8
#define NUMOFBLOCKS N/block_size/block_size
#ifndef U
#define U 8
#endif
void bbgemm(TYPE m1[N], TYPE m2[N], TYPE prod[N]){
#pragma ss config
{
int i, k, j, jj, kk;
int i_row, k_row;
TYPE temp_x, mul;
for (jj = 0; jj < row_size; jj += block_size){
//for (kk = 0; kk < row_size; kk += block_size){
for ( i = 0; i < row_size; ++i){
#pragma ss stream nonblock
for (k = 0; k < row_size; ++k){
i_row = i * row_size;
//k_row = (k + kk) * row_size;
kk = 0;
temp_x = m1[i_row + k + kk];
#pragma ss dfg dedicated unroll(U)
for (j = 0; j < block_size; ++j){
mul = temp_x * m2[k_row + j + jj];
prod[i_row + j + jj] += mul;
}
}
}
//}
}
}
}
void accumulate_cgra(TYPE const* src, int srcRows, int srcCols, int srcStep, int srcChannels,
TYPE* dest, int destRows, int destCols, int destStep, int destChannels){
assert(srcRows == destRows && srcCols == destCols && srcStep == destStep && srcChannels==destChannels);
#pragma ss config
{
int jj, i, j, k;
TYPE temp1, temp2;
int rows = srcRows;
int cols = srcCols;
int channels = srcChannels;
for(jj=0; jj<cols; jj+=block_size){
for(i=0; i<rows; ++i){
int residue = std::min(jj+block_size,cols);
#pragma ss stream nonblock
#pragma ss dfg dedicated unroll(U)
for(j=jj; j<residue; ++j){
for(k=0; k<channels; ++k){
temp1 = dest[i*cols + j*channels + k];
temp2 = src[i*cols + j*channels + k];
temp1 += temp2;
dest[i*cols + j*channels + k] = temp1;
}
}
}
}
}
}
void accumulate(TYPE src[N], int srcRows, int srcCols,
TYPE dest[N], int destRows, int destCols){
assert(srcRows == destRows && srcCols == destCols);
#pragma ss config
{
int jj, i, j;
TYPE temp1, temp2;
int rows = srcRows;
int cols = srcCols;
for(jj=0; jj<cols; jj+=block_size){
for(i=0; i<rows; ++i){
int residue = std::min(jj+block_size,cols);
#pragma ss stream nonblock
//#pragma ss dfg dedicated unroll(U)
for(j=jj; j<residue; ++j){
temp1 = dest[i*cols + j];
temp2 = src[i*cols + j];
temp1 += temp2;
dest[i*cols + j] = temp1;
}
}
}
}
}
//TYPE a[N], b[N], c[N];
TYPE* src, *dest;
int main() {
srand (static_cast (time(0)));
src = (TYPE*) malloc(sizeof(TYPE)row_sizecol_sizeC);
if(!src){
fprintf(stderr, "ERROR: Could not malloc src, %s", strerror(errno));
}
dest = (TYPE) malloc(sizeof(TYPE)row_sizecol_size*C);
if(!dest){
fprintf(stderr, "ERROR: Could not malloc dest, %s", strerror(errno));
}
for(int i=0; i<row_size; ++i){
for(int j=0; j<col_size; ++j){
for(int k=0; k<C; ++k){
src[icol_size + jC + k] = static_cast (rand()) / static_cast (RAND_MAX);;
}
}
}
//cache warmup
for(int i=0;i<CACHE_WARMUP;++i)
accumulate_cgra(src, row_size, col_size, col_size, C, dest, row_size, col_size, col_size, C);
begin_roi();
accumulate_cgra(src, row_size, col_size, col_size, C, dest, row_size, col_size, col_size, C);
//bbgemm(a,b,c);
end_roi();
sb_stats();
free(src);
free(dest);
return 0;
}
`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.