35 #include <CLUtils.hpp>
91 Mult (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
98 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
101 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
103 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
111 clutils::CLEnvInfo<1> &info;
113 cl::CommandQueue queue;
117 unsigned int length, bufferSize;
118 cl::Buffer hBufferInA, hBufferInB, hBufferOut;
119 cl::Buffer dBufferInA, dBufferInB, dBufferOut;
129 template <
typename period>
130 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
132 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
133 queue.flush (); timer.wait ();
134 return timer.duration ();
176 Pown (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
183 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
186 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
188 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
199 clutils::CLEnvInfo<1> &info;
201 cl::CommandQueue queue;
205 unsigned int length, bufferSize;
207 cl::Buffer hBufferIn, hBufferOut;
208 cl::Buffer dBufferIn, dBufferOut;
218 template <
typename period>
219 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
221 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
222 queue.flush (); timer.wait ();
223 return timer.duration ();
232 #endif // GF_MATH_HPP
int getPower()
Gets the power.
Definition: math.cpp:450
void write(Mult::Memory mem=Mult::Memory::D_IN_A, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: math.cpp:197
Mult(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: math.cpp:56
Memory
Enumerates the memory objects handled by the class.
Definition: math.hpp:167
void * read(Mult::Memory mem=Mult::Memory::H_OUT, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: math.cpp:230
Interface class for the mult kernel.
Definition: math.hpp:73
Interface class for the pown_ kernel.
Definition: math.hpp:160
Staging
Enumerates staging buffer configurations.
Definition: common.hpp:43
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: math.hpp:219
Offers classes which set up kernel execution parameters and provide interfaces for the handling of me...
Definition: algorithms.hpp:43
cl_float * hPtrInB
Definition: math.hpp:106
Declares classes used by the OpenCL interface classes in cl_algo.
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: math.cpp:442
void * read(Pown::Memory mem=Pown::Memory::H_OUT, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: math.cpp:419
void init(unsigned int _width, unsigned int _height, int _n, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: math.cpp:302
void write(Pown::Memory mem=Pown::Memory::D_IN, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: math.cpp:391
cl_float * hPtrInA
Definition: math.hpp:105
Memory
Enumerates the memory objects handled by the class.
Definition: math.hpp:80
void init(unsigned int _width, unsigned int _height, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: math.cpp:99
cl_float * hPtrOut
Definition: math.hpp:107
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: math.hpp:130
cl_float * hPtrIn
Definition: math.hpp:194
Pown(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: math.cpp:262
Definition: helper_funcs.hpp:41
cl_float * hPtrOut
Definition: math.hpp:195
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: math.cpp:253
void setPower(int _n)
Sets the power.
Definition: math.cpp:460