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
이 커밋은 다음에 포함됨:
foreman가 2018-04-06 12:39:00 -04:00를 커밋했습니다
1 부모 2809f029b1
커밋 c006b7b262
4 파일이 변경됨
+52 -36

검색과 일치하는 파일 없음

+12 -3
파일 보기
@@ -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