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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user