Large amount done. OpenCL is almost completely abstracted out to the class

from init to kernel compilation. Next will be getting buffer handling, executing, and reading done.
Changed the kernel to a more minimal example.
Added a jump table for error codes and an assert function for error checking.
Added a routine to compare all the available cl devices and platforms, chooses the high clock of either the GPU or CPU.
This commit is contained in:
2016-08-15 00:07:30 -07:00
parent ce2623f302
commit 5dea2494a0
8 changed files with 497 additions and 355 deletions

View File

@@ -2,6 +2,8 @@
#include <SFML/Graphics.hpp>
#include <iostream>
#include <math.h>
#include <fstream>
#include <sstream>
const double PI = 3.141592653589793238463;
const float PI_F = 3.14159265358979f;
@@ -87,4 +89,17 @@ inline float DegreesToRadians(float in) {
inline float RadiansToDegrees(float in) {
return in * 180.0f / PI;
}
}
inline std::string read_file(std::string file_name){
std::ifstream input_file(file_name);
if (!input_file.is_open()){
std::cout << file_name << " could not be opened" << std::endl;
return nullptr;
}
std::stringstream buf;
buf << input_file.rdbuf();
return buf.str();
}