P4 to Git Change 1747723 by cpaquot@cpaquot-ocl-lc-lnx on 2019/02/22 19:30:33

SWDEV-145570 - [HIP] Texture object implementation
	hipTextureObject2D test passes on PAL backend.
	Still needs to have sampler handled properly on ROCm backend.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_texture.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#333 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#36 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#14 edit


[ROCm/clr commit: a0ba1c67c2]
This commit is contained in:
foreman
2019-02-22 19:43:36 -05:00
parent a5e9e3964d
commit 206e531c60
4 changed files with 12 additions and 4 deletions
@@ -732,6 +732,9 @@ class Memory : public amd::HeapObject {
virtual uint64_t virtualAddress() const { return 0; }
//! Returns CPU pointer to HW state
virtual const address cpuSrd() const { return nullptr; }
virtual void IpcCreate(size_t offset, size_t* mem_size, void* handle) const {
ShouldNotReachHere();
}
@@ -778,7 +781,7 @@ class Memory : public amd::HeapObject {
class Sampler : public amd::HeapObject {
public:
//! Constructor
Sampler() : hwSrd_(0) {}
Sampler() : hwSrd_(0), hwState_(nullptr) {}
//! Default destructor for the device memory object
virtual ~Sampler(){};
@@ -786,8 +789,12 @@ class Sampler : public amd::HeapObject {
//! Returns device specific HW state for the sampler
uint64_t hwSrd() const { return hwSrd_; }
//! Returns CPU pointer to HW state
const address hwState() const { return hwState_; }
protected:
uint64_t hwSrd_; //!< Device specific HW state for the sampler
address hwState_; //!< CPU pointer to HW state
private:
//! Disable default copy constructor
@@ -169,8 +169,6 @@ class Sampler : public device::Sampler {
bool create(const amd::Sampler& owner //!< AMD sampler object
);
const void* hwState() const { return hwState_; }
private:
//! Disable default copy constructor
Sampler& operator=(const Sampler&);
@@ -179,7 +177,6 @@ class Sampler : public device::Sampler {
Sampler(const Sampler&);
const Device& dev_; //!< Device object associated with the sampler
address hwState_; //!< GPU HW state (\todo legacy path)
};
//! A GPU device ordinal (physical GPU device)
@@ -119,6 +119,8 @@ class Memory : public device::Memory, public Resource {
virtual uint64_t virtualAddress() const override { return vmAddress(); }
virtual const address cpuSrd() const { return reinterpret_cast<const address>(const_cast<void*>(hwState())); }
//! Allocates host memory for synchronization with MGPU context
void mgpuCacheWriteBack();
@@ -78,6 +78,8 @@ class Memory : public device::Memory {
virtual uint64_t virtualAddress() const override { return reinterpret_cast<uint64_t>(getDeviceMemory()); }
virtual const address cpuSrd() const override { return reinterpret_cast<const address>(getDeviceMemory()); }
// Accessors for indirect map memory object
amd::Memory* mapMemory() const { return mapMemory_; }