Files
rocm-systems/rocclr/runtime/device/pal/palconstbuf.hpp
T
foreman 9b99d758cd P4 to Git Change 1258631 by gandryey@gera-w8 on 2016/04/15 15:02:11
SWDEV-86035 - Add PAL backend to OpenCL
	- Switch #pragma once

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palappprofile.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palbinary.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palblit.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palconstbuf.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcounters.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldebugger.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldebugmanager.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldefs.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.hpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprintf.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsched.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palthreadtrace.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paltimestamp.hpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palwavelimiter.hpp#2 edit
2016-04-15 15:48:36 -04:00

67 lines
1.8 KiB
C++

//
// Copyright (c) 2015 Advanced Micro Devices, Inc. All rights reserved.
//
#pragma once
#include "device/pal/palmemory.hpp"
//! \namespace pal PAL Resource Implementation
namespace pal {
//! Cconstant buffer
class ConstBuffer : public Memory
{
public:
//! Vector size of the constant buffer
static const size_t VectorSize = 16;
//! Constructor for the ConstBuffer class
ConstBuffer(
VirtualGPU& gpu, //!< Virtual GPU device object
size_t size //!< size of the constant buffer in vectors
);
//! Destructor for the ConstBuffer class
~ConstBuffer();
//! Creates the real HW constant buffer
bool create();
/*! \brief Uploads current constant buffer data from sysMemCopy_ to HW
*
* \return True if the data upload was succesful
*/
bool uploadDataToHw(
size_t size //!< real data size for upload
);
//! Returns a pointer to the system memory copy for CB
address sysMemCopy() const { return sysMemCopy_; }
//! Returns CB size
size_t size() const { return size_; }
//! Returns current write offset for the constant buffer
size_t wrtOffset() const { return wrtOffset_; }
//! Returns last write size for the constant buffer
size_t lastWrtSize() const { return lastWrtSize_; }
private:
//! Disable copy constructor
ConstBuffer(const ConstBuffer&);
//! Disable operator=
ConstBuffer& operator=(const ConstBuffer&);
VirtualGPU& gpu_; //!< Virtual GPU object
address sysMemCopy_; //!< System memory copy
size_t size_; //!< Constant buffer size
size_t wrtOffset_; //!< Current write offset
size_t lastWrtSize_; //!< Last write size
void* wrtAddress_; //!< Write address in CB
};
/*@}*/} // namespace pal