#pragma once #include #include "../cl.hpp" class TestCase { private: std::string kernelCode; public: virtual void collect_results(cl::CommandQueue* queue) = 0; virtual void gpu_compute( cl::Context* context, cl::CommandQueue* queue, cl::Program* program, cl::Event* Event ) = 0; virtual void cpu_compute() = 0; virtual bool validate_results() = 0; }; class Square : public TestCase { private: size_t data_size = 4096; std::vector gpuHostBuffer; std::vector sourceData; std::vector cpuResult; cl::Buffer clInputBuffer; cl::Buffer clResultBuffer; public: Square(); void collect_results(cl::CommandQueue* queue); void gpu_compute(cl::Context* context, cl::CommandQueue* queue, cl::Program* program, cl::Event* Event); void cpu_compute(); bool validate_results(); };