-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
72 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .context import initialize_thriller_flow | ||
from .buffer import create_buffer |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import thriller_flow | ||
from thriller_flow import PyBuffer | ||
from .context import PyBuffer | ||
|
||
|
||
def create_buffer(name): | ||
|
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 @@ | ||
from thriller_flow import * |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
|
||
import context | ||
import thriller_flow | ||
|
||
import pythriller | ||
|
||
if __name__ == '__main__': | ||
thriller_flow.initialize_thriller_flow() | ||
pythriller.initialize_thriller_flow() | ||
g_a = pythriller.create_buffer("g_a") | ||
g_b = pythriller.create_buffer("g_b") | ||
g_c = pythriller.create_buffer("g_c") | ||
|
||
print(g_a, g_b, g_c) | ||
print(g_a) | ||
print(g_b) | ||
print(g_c) |
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 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,44 @@ | ||
use std::collections::HashSet; | ||
use std::hash::Hash; | ||
use std::rc::Rc; | ||
|
||
use crate::AccessMap; | ||
|
||
use super::block::ThrillerBlock; | ||
|
||
pub struct AccessMapPtr<'a>(&'a Rc<AccessMap>); | ||
|
||
impl<'a> Hash for AccessMapPtr<'a> { | ||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) { | ||
state.write_usize(Rc::as_ptr(self.0) as usize) | ||
} | ||
} | ||
|
||
impl ThrillerBlock { | ||
#[allow(dead_code)] | ||
pub(crate) fn merge_loop(&self) -> HashSet<AccessMapPtr> { | ||
let mut sets = HashSet::new(); | ||
|
||
self.get_inputs().iter().for_each(|edge| { | ||
if let Some(access_map) = edge.get_access() { | ||
let ptr = AccessMapPtr(access_map); | ||
sets.insert(ptr); | ||
} | ||
}); | ||
|
||
sets | ||
} | ||
} | ||
|
||
impl<'a> PartialEq for AccessMapPtr<'a> { | ||
fn eq(&self, other: &Self) -> bool { | ||
// TODO: Implement this function.s | ||
Rc::ptr_eq(self.0, other.0) | ||
} | ||
} | ||
|
||
impl<'a> Eq for AccessMapPtr<'a> { | ||
fn assert_receiver_is_total_eq(&self) { | ||
todo!("Implement this function") | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod block; | ||
mod edge; | ||
mod graph; | ||
mod loop_analysis; | ||
mod node; | ||
|
||
pub use block::{BlockType, ThrillerBlock}; | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
#![deny(warnings)] | ||
#![deny(missing_docs)] | ||
|
||
mod access; | ||
mod buffer; | ||
mod dataflow; | ||
|