mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-16 13:14:51 -04:00
Replace unsigned int, and char with uint and uchar.
This commit is contained in:
@ -104,7 +104,7 @@ class EMBERCL_API OpenCLWrapper : public EmberReport
|
||||
public:
|
||||
OpenCLWrapper();
|
||||
bool CheckOpenCL();
|
||||
bool Init(unsigned int platform, unsigned int device, bool shared = false);
|
||||
bool Init(uint platform, uint device, bool shared = false);
|
||||
|
||||
//Programs.
|
||||
bool AddProgram(const string& name, const string& program, const string& entryPoint, bool doublePrecision);
|
||||
@ -114,22 +114,22 @@ public:
|
||||
bool AddBuffer(const string& name, size_t size, cl_mem_flags flags = CL_MEM_READ_WRITE);
|
||||
bool AddAndWriteBuffer(const string& name, void* data, size_t size, cl_mem_flags flags = CL_MEM_READ_WRITE);
|
||||
bool WriteBuffer(const string& name, void* data, size_t size);
|
||||
bool WriteBuffer(unsigned int bufferIndex, void* data, size_t size);
|
||||
bool WriteBuffer(uint bufferIndex, void* data, size_t size);
|
||||
bool ReadBuffer(const string& name, void* data, size_t size);
|
||||
bool ReadBuffer(unsigned int bufferIndex, void* data, size_t size);
|
||||
bool ReadBuffer(uint bufferIndex, void* data, size_t size);
|
||||
int FindBufferIndex(const string& name);
|
||||
unsigned int GetBufferSize(const string& name);
|
||||
unsigned int GetBufferSize(unsigned int bufferIndex);
|
||||
uint GetBufferSize(const string& name);
|
||||
uint GetBufferSize(uint bufferIndex);
|
||||
void ClearBuffers();
|
||||
|
||||
//Images.
|
||||
bool AddAndWriteImage(const string& name, cl_mem_flags flags, const cl::ImageFormat& format, ::size_t width, ::size_t height, ::size_t row_pitch, void* data = NULL, bool shared = false, GLuint texName = 0);
|
||||
bool WriteImage2D(unsigned int index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data);
|
||||
bool WriteImage2D(uint index, bool shared, ::size_t width, ::size_t height, ::size_t row_pitch, void* data);
|
||||
bool ReadImage(const string& name, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
bool ReadImage(unsigned int imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
bool ReadImage(uint imageIndex, ::size_t width, ::size_t height, ::size_t row_pitch, bool shared, void* data);
|
||||
int FindImageIndex(const string& name, bool shared);
|
||||
unsigned int GetImageSize(const string& name, bool shared);
|
||||
unsigned int GetImageSize(unsigned int imageIndex, bool shared);
|
||||
uint GetImageSize(const string& name, bool shared);
|
||||
uint GetImageSize(uint imageIndex, bool shared);
|
||||
bool CompareImageParams(cl::Image& image, cl_mem_flags flags, const cl::ImageFormat& format, ::size_t width, ::size_t height, ::size_t row_pitch);
|
||||
void ClearImages(bool shared);
|
||||
bool CreateImage2D(cl::Image2D& image2D, cl_mem_flags flags, cl::ImageFormat format, ::size_t width, ::size_t height, ::size_t row_pitch = 0, void* data = NULL);
|
||||
@ -143,10 +143,10 @@ public:
|
||||
bool CreateSampler(cl::Sampler& sampler, cl_bool normalizedCoords, cl_addressing_mode addressingMode, cl_filter_mode filterMode);
|
||||
|
||||
//Arguments.
|
||||
bool SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, const string& name);
|
||||
bool SetBufferArg(unsigned int kernelIndex, unsigned int argIndex, unsigned int bufferIndex);
|
||||
bool SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, const string& name);
|
||||
bool SetImageArg(unsigned int kernelIndex, unsigned int argIndex, bool shared, unsigned int imageIndex);
|
||||
bool SetBufferArg(uint kernelIndex, uint argIndex, const string& name);
|
||||
bool SetBufferArg(uint kernelIndex, uint argIndex, uint bufferIndex);
|
||||
bool SetImageArg(uint kernelIndex, uint argIndex, bool shared, const string& name);
|
||||
bool SetImageArg(uint kernelIndex, uint argIndex, bool shared, uint imageIndex);
|
||||
|
||||
/// <summary>
|
||||
/// Set an argument in the specified kernel, at the specified argument index.
|
||||
@ -157,7 +157,7 @@ public:
|
||||
/// <param name="arg">The argument value to set</param>
|
||||
/// <returns>True if success, else false</returns>
|
||||
template <typename T>
|
||||
bool SetArg(unsigned int kernelIndex, unsigned int argIndex, T arg)
|
||||
bool SetArg(uint kernelIndex, uint argIndex, T arg)
|
||||
{
|
||||
if (m_Init && kernelIndex < m_Programs.size())
|
||||
{
|
||||
@ -171,7 +171,7 @@ public:
|
||||
|
||||
//Kernels.
|
||||
int FindKernelIndex(const string& name);
|
||||
bool RunKernel(unsigned int kernelIndex, unsigned int totalGridWidth, unsigned int totalGridHeight, unsigned int totalGridDepth, unsigned int blockWidth, unsigned int blockHeight, unsigned int blockDepth);
|
||||
bool RunKernel(uint kernelIndex, uint totalGridWidth, uint totalGridHeight, uint totalGridDepth, uint blockWidth, uint blockHeight, uint blockDepth);
|
||||
|
||||
//Info.
|
||||
template<typename T>
|
||||
@ -187,11 +187,11 @@ public:
|
||||
bool Ok() const;
|
||||
bool Shared() const;
|
||||
cl::Context Context() const;
|
||||
unsigned int PlatformIndex() const;
|
||||
unsigned int DeviceIndex() const;
|
||||
unsigned int LocalMemSize() const;
|
||||
uint PlatformIndex() const;
|
||||
uint DeviceIndex() const;
|
||||
uint LocalMemSize() const;
|
||||
|
||||
static void MakeEvenGridDims(unsigned int blockW, unsigned int blockH, unsigned int& gridW, unsigned int& gridH);
|
||||
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
||||
|
||||
private:
|
||||
bool CreateContext(bool shared);
|
||||
@ -201,9 +201,9 @@ private:
|
||||
|
||||
bool m_Init;
|
||||
bool m_Shared;
|
||||
unsigned int m_PlatformIndex;
|
||||
unsigned int m_DeviceIndex;
|
||||
unsigned int m_LocalMemSize;
|
||||
uint m_PlatformIndex;
|
||||
uint m_DeviceIndex;
|
||||
uint m_LocalMemSize;
|
||||
cl::Platform m_Platform;
|
||||
cl::Context m_Context;
|
||||
cl::Device m_Device;
|
||||
|
Reference in New Issue
Block a user