Skip to content

Commit

Permalink
refactor/tensor: refactor synchronization and memory access interface
Browse files Browse the repository at this point in the history
Remove methods `sync()`, `get()`, `get_mut()`, `remove_copy()` of
`SharedTensor` and introduce new set of methods: `read()`, `read_write()`,
`write_only()`, `drop_device()`. Signature of `SharedTensor::new()` has also
changed.

New API has following benefits:
 - limited checks of use of uninitialized memory,
 - better memory tracking: several memories can be simultaneously marked as
   up-to-date, so some synchronization operations might be skipped,
 - backing memory is automatically allocated on the first use and added to
   `SharedTensor`, even if it's immutable. Mutability is required only for
   reshaping, modifying actual data and dropping memories.

Rationale and design decisions are discussed at the corresponding bugtracker
issue.

BREAKING CHANGE: sync and memory management API of `SharedTensor`

CLOSE: autumnai#37
  • Loading branch information
alexandermorozov committed Apr 18, 2016
1 parent 2ac7e87 commit 18a4db9
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 151 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum_primitive = "0.1.0"
byteorder = "0.4"
num = "0.1"
lazy_static = "0.1.15"
linear-map = "0.0.4"

clippy = { version = "0.0.27", optional = true }

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ extern crate enum_primitive;
extern crate lazy_static;
extern crate num;
extern crate byteorder;
extern crate linear_map;

pub mod backend;
pub mod device;
Expand Down
Loading

0 comments on commit 18a4db9

Please sign in to comment.