Skip to content

Commit

Permalink
update analyzed_proc_list to include instrs
Browse files Browse the repository at this point in the history
  • Loading branch information
yamaguchi1024 committed Oct 3, 2024
1 parent 1a3d982 commit a56b737
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/exo/LoopIR_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def from_lines(x):
private_fwd_decls = []
proc_bodies = []
instrs_global = []
new_proc_list = []
analyzed_proc_list = []

needed_helpers = set()

Expand Down Expand Up @@ -410,7 +410,6 @@ def from_lines(x):
p = PrecisionAnalysis().run(p)
p = WindowAnalysis().apply_proc(p)
p = MemoryAnalysis().run(p)
new_proc_list.append(p)

comp = Compiler(p, ctxt_name, is_public_decl=is_public_decl)
d, b = comp.comp_top()
Expand All @@ -424,6 +423,8 @@ def from_lines(x):

proc_bodies.append(b)

analyzed_proc_list.append(p)

# Structs are just blobs of code... still sort them for output stability
struct_defns = [x.definition for x in sorted(struct_defns, key=lambda x: x.name)]

Expand Down Expand Up @@ -454,8 +455,8 @@ def from_lines(x):
{from_lines(public_fwd_decls)}
"""

memory_code = _compile_memories(find_all_mems(new_proc_list))
extern_code = _compile_externs(find_all_externs(new_proc_list))
memory_code = _compile_memories(find_all_mems(analyzed_proc_list))
extern_code = _compile_externs(find_all_externs(analyzed_proc_list))

helper_code = [_static_helpers[v] for v in needed_helpers]
body_contents = [
Expand Down
5 changes: 5 additions & 0 deletions tests/golden/asplos25/test_gemmini_matmul_new/test_matmul.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ void matmul_on_gemmini( c_code_str_Context *ctxt, int_fast32_t N, int_fast32_t M
#include "gemm_acc_malloc.h"
#include <include/gemmini.h>
#include "gemm_malloc.h"
int8_t _relu_int8_t(int8_t x) {
if (x > 0.0) return x;
else return 0.0;
}


/* relying on the following instruction..."
config_ld_i8_id1(src_stride)
Expand Down
5 changes: 5 additions & 0 deletions tests/golden/test_apps/test_x86_conv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ void conv_specialized( void *ctxt, const float* inp, float* output, const float*
#include <stdio.h>
#include <stdlib.h>

float _relu_float(float x) {
if (x > 0.0) return x;
else return 0.0;
}

// conv_specialized(
// inp : f32[5, 82, 102, 128] @DRAM,
// output : f32[5, 80, 100, 128] @DRAM,
Expand Down

0 comments on commit a56b737

Please sign in to comment.