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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user