0da70b03de
SWDEV-120180 - [amdgpu-pro] OpenCL support for SSG - Add initial support of DGMA memory under ROCr backend. - The implementation requires amdgpu-pro stack initialization and memory allocation. - An interop with HSA device is created for ROCr access Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/Makefile#10 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#153 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_lqdflash_amd.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#285 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#351 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/lnxheaders.h#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.cpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodevice.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/pro/prodriver.hpp#1 add ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#51 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#21 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#18 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#11 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#101 edit ... //depot/stg/opencl/drivers/opencl/runtime/runtimedefs#41 edit
54 lines
1.4 KiB
C++
54 lines
1.4 KiB
C++
//
|
|
// Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#ifndef WITHOUT_HSA_BACKEND
|
|
|
|
#include "prodriver.hpp"
|
|
#include "thread/monitor.hpp"
|
|
#include <map>
|
|
|
|
/*! \addtogroup HSA
|
|
* @{
|
|
*/
|
|
|
|
//! HSA Device Implementation
|
|
namespace roc {
|
|
|
|
class ProDevice : public IProDevice {
|
|
public:
|
|
ProDevice()
|
|
: file_desc_(0)
|
|
, major_ver_(0)
|
|
, minor_ver_(0)
|
|
, cp_ver_(0)
|
|
, alloc_ops_(nullptr) {}
|
|
virtual ~ProDevice() override;
|
|
|
|
bool Create(uint32_t bus, uint32_t device, uint32_t func);
|
|
|
|
virtual void* AllocDmaBuffer(
|
|
hsa_agent_t agent, size_t size, void** host_ptr) const override;
|
|
virtual void FreeDmaBuffer(void* ptr) const override;
|
|
|
|
private:
|
|
int32_t file_desc_; //!< File descriptor for the device
|
|
uint32_t major_ver_; //!< Major driver version
|
|
uint32_t minor_ver_; //!< Minor driver version
|
|
uint32_t cp_ver_; //!< CP ucode version
|
|
amdgpu_device_handle dev_handle_; //!< AMD gpu device handle
|
|
amdgpu_gpu_info gpu_info_; //!< GPU info structure
|
|
amdgpu_heap_info heap_info_; //!< Information about memory
|
|
mutable std::map<void*, std::pair<amdgpu_bo_handle, uint32_t>> allocs_; //!< Alloced memory mapping
|
|
amd::Monitor* alloc_ops_; //!< Serializes memory allocations/destructions
|
|
};
|
|
|
|
} // namespace roc
|
|
|
|
/**
|
|
* @}
|
|
*/
|
|
#endif /*WITHOUT_HSA_BACKEND*/
|