P4 to Git Change 1537540 by gandryey@gera-w8 on 2018/04/06 12:30:49
SWDEV-79445 - OCL generic changes and code clean-up
- Reduce the managed buffer alignment to 128 bytes
- Add direct upload function to the constant buffer
- Add heap preference print into the active allocations
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palconstbuf.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palconstbuf.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#49 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#87 edit
[ROCm/clr commit: c006b7b262]
Este commit está contenido en:
@@ -53,7 +53,8 @@ bool ManagedBuffer::create(Resource::MemoryType type) {
|
||||
|
||||
// ================================================================================================
|
||||
address ManagedBuffer::reserve(uint32_t size, uint64_t* gpu_address) {
|
||||
static constexpr uint32_t MemAlignment = 256;
|
||||
// Align to the maximum data size available in OpenCL
|
||||
static constexpr uint32_t MemAlignment = sizeof(cl_double16);
|
||||
|
||||
// Align reserve size on the vector's boundary
|
||||
uint32_t count = amd::alignUp(size, MemAlignment);
|
||||
@@ -103,8 +104,7 @@ bool ConstantBuffer::Create() {
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
uint64_t ConstantBuffer::UploadDataToHw(uint32_t size) const
|
||||
{
|
||||
uint64_t ConstantBuffer::UploadDataToHw(uint32_t size) const {
|
||||
uint64_t vm_address;
|
||||
address cpu_address = mbuf_.reserve(size, &vm_address);
|
||||
// Update memory with new CB data
|
||||
@@ -112,4 +112,13 @@ uint64_t ConstantBuffer::UploadDataToHw(uint32_t size) const
|
||||
return vm_address;
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
uint64_t ConstantBuffer::UploadDataToHw(const void* sysmem, uint32_t size) const {
|
||||
uint64_t vm_address;
|
||||
address cpu_address = mbuf_.reserve(size, &vm_address);
|
||||
// Update memory with new CB data
|
||||
memcpy(cpu_address, sysmem, size);
|
||||
return vm_address;
|
||||
}
|
||||
|
||||
} // namespace pal
|
||||
|
||||
Referencia en una nueva incidencia
Block a user