Invalidate caches after allocating a code object
Due to a misinterpretation of the HSA specification the microcode has, until now, been responsible for ensuring a coherent view of the amd_kernel_code_t object when acquire_fence_scope is set to agent or system. To correct this the runtime must instead assume this responsibility. Introduce GpuAgentInt::InvalidateCodeCaches to perform this operation on-demand. Invoke this after code object allocation. Extend the Queue implementations to support PM4 command submission, through which the PM4 command ACQUIRE_MEM can be submitted to perform cache invalidation. Submit through a runtime-managed queue shared with the blit implementation. This change depends on microcode support and this is checked against the running version. Older microcode builds will perform cache invalidation themselves, so it is acceptable for this change to do nothing in that case. Change-Id: I268dd2b83af3decdd9ad07430a81df8a2ecb6bd2
This commit is contained in:
@@ -143,6 +143,10 @@ class HostQueue : public Queue {
|
||||
return HSA_STATUS_ERROR;
|
||||
}
|
||||
|
||||
void ExecutePM4(uint32_t* cmd_data, size_t cmd_size_b) override {
|
||||
assert(false && "HostQueue::ExecutePM4 is unimplemented");
|
||||
}
|
||||
|
||||
bool active() const { return active_; }
|
||||
|
||||
void* operator new(size_t size) {
|
||||
|
||||
Reference in New Issue
Block a user