-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snakemake: Add simple_copy kernel (#312)
* Add initial snakefile * Move simple_copy to snakemake * Remove makefile and clean up data generation
- Loading branch information
1 parent
c523293
commit d8c421e
Showing
5 changed files
with
73 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from util.snake.configs import get_snax_mac_config | ||
|
||
config = get_snax_mac_config() | ||
config["snaxoptflags"] = ",".join( | ||
[ | ||
"dispatch-kernels", | ||
"set-memory-space", | ||
"set-memory-layout", | ||
"realize-memref-casts", | ||
"reuse-memref-allocs", | ||
"insert-sync-barrier", | ||
"dispatch-regions", | ||
"linalg-to-library-call", | ||
"snax-copy-to-dma", | ||
"memref-to-snax", | ||
"snax-to-func", | ||
"clear-memory-space", | ||
] | ||
) | ||
|
||
|
||
module default_rules: | ||
snakefile: | ||
"../../util/snake/default_rules.smk" | ||
config: | ||
config | ||
|
||
|
||
use rule * from default_rules as default_* | ||
|
||
|
||
# Rules | ||
rule all: | ||
input: | ||
"simple_copy.x", | ||
shell: | ||
"{config[vltsim]} {input[0]}" | ||
|
||
|
||
rule compile_main: | ||
input: | ||
"main.c", | ||
"data.h", | ||
output: | ||
"main.o", | ||
shell: | ||
"{config[cc]} {config[cflags]} -c {input[0]}" | ||
|
||
|
||
rule link_snax_binary: | ||
input: | ||
"simple_copy.o", | ||
"main.o", | ||
"data.o", | ||
output: | ||
"simple_copy.x", | ||
shell: | ||
"{config[ld]} {config[ldflags]} {input} -o {output}" | ||
|
||
|
||
from gendata import create_data_files | ||
|
||
|
||
rule generate_data: | ||
output: | ||
"data.c", | ||
"data.h", | ||
run: | ||
create_data_files() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters