Skip to content

Commit

Permalink
Add buffer sync methods hannk::Tensor class
Browse files Browse the repository at this point in the history
Add few methods for GPU memory interaction.
  • Loading branch information
terryheo committed Feb 6, 2023
1 parent 91f3ac0 commit 44a01b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/hannk/interpreter/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ class Tensor {
void allocate_from_heap();
void allocate_from_arena_pointer(void *host);

// HalideBuffer methods for GPU interactions.
void set_host_dirty (bool dirty = true) { buffer_.set_host_dirty(dirty); }
void copy_to_host() { buffer_.copy_to_host(); }
bool device_dirty() const { return buffer_.device_dirty(); }
bool host_dirty() const { return buffer_.host_dirty(); }

void resize_dynamic(const Box &new_shape);

AliasType alias_type() const {
Expand Down

0 comments on commit 44a01b9

Please sign in to comment.