Browse Source

OPenCLHandler parameters

master
Daniel Gyulai 3 years ago
parent
commit
fe982be9ea
  1. 5
      Common/OpenCLHandler.cpp
  2. 2
      Common/OpenCLHandler.h
  3. 2
      Primitives/Primitives.cpp

5
Common/OpenCLHandler.cpp

@ -25,7 +25,7 @@ void OpenCLHandler::printTimeStats(cl::Event& event)
std::endl; std::endl;
} }
OpenCLHandler::OpenCLHandler() OpenCLHandler::OpenCLHandler(std::string kernelcode)
{ {
cl_int err = CL_SUCCESS; cl_int err = CL_SUCCESS;
@ -57,7 +57,8 @@ OpenCLHandler::OpenCLHandler()
cl::Event event; cl::Event event;
queue = cl::CommandQueue(context, devices[0], CL_QUEUE_PROFILING_ENABLE, &err); queue = cl::CommandQueue(context, devices[0], CL_QUEUE_PROFILING_ENABLE, &err);
// Create the OpenCL program // Create the OpenCL program
std::string programSource = FileToString("../kernels/programs.cl"); //std::string programSource = FileToString("../kernels/programs.cl");
std::string programSource = FileToString(kernelcode);
program = cl::Program(context, programSource); program = cl::Program(context, programSource);
program.build(devices); program.build(devices);
} }

2
Common/OpenCLHandler.h

@ -10,7 +10,7 @@ private:
size_t max_workgroup_size; size_t max_workgroup_size;
void printTimeStats(cl::Event& event); void printTimeStats(cl::Event& event);
public: public:
OpenCLHandler(); OpenCLHandler(std::string kernelcode);
bool run_test(TestCase* test); bool run_test(TestCase* test);
size_t get_max_size(); size_t get_max_size();
}; };

2
Primitives/Primitives.cpp

@ -61,7 +61,7 @@ int main()
{ {
//capi(); //capi();
OpenCLHandler handler; OpenCLHandler handler("../kernels/programs.cl");
std::vector<TestCase*> tests; std::vector<TestCase*> tests;
Square s; Square s;

Loading…
Cancel
Save