Refactor staging buffer and sync copies.

- refactor staging buffer to operate on hsa* data structures not
  hc::accelerator.
- use hsa_memory_allocate to allocate staging buffers rather than
  am_alloc.
- Refactor device reset with single member function.  Don't reallocate
  staging buffers on reset.
- Properly track dependencies based on command type.  Add new deps for
  H2D and D2D rather than overloading H2D.


[ROCm/hip commit: 7d500599fa]
This commit is contained in:
Ben Sander
2016-03-17 20:09:10 -05:00
parent fc27c61c58
commit 3320975a80
3 changed files with 57 additions and 51 deletions
@@ -8,7 +8,7 @@ struct StagingBuffer {
static const int _max_buffers = 4;
StagingBuffer(hc::accelerator &acc, size_t bufferSize, int numBuffers) ;
StagingBuffer(hsa_agent_t hsaAgent, hsa_region_t systemRegion, size_t bufferSize, int numBuffers) ;
~StagingBuffer();
void CopyHostToDevice(void* dst, const void* src, size_t sizeBytes, hsa_signal_t *waitFor);
@@ -19,7 +19,6 @@ struct StagingBuffer {
private:
hc::accelerator &_acc;
hsa_agent_t _hsa_agent;
size_t _bufferSize; // Size of the buffers.
int _numBuffers;