BMEVIIIMB01
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

73 lines
1.8 KiB

// Primitives.cpp : Defines the entry point for the console application.
#include <string>
#include <vector>
#include <iostream>
#include "Common.h"
#include "OpenCLHandler.h"
#include "primitives/Tests.h"
// OpenCL C API
#include <CL/opencl.h>
// OpenCL C++ API
#include "cl.hpp"
//const size_t dataSize = 4096;
//
//void capi()
//{
// // Get a platform ID
// cl_platform_id platformID;
// clGetPlatformIDs(1, &platformID, NULL);
//
// // Get a device ID
// cl_device_id deviceID;
// clGetDeviceIDs(platformID, CL_DEVICE_TYPE_GPU, 1, &deviceID, NULL);
//
// // Create a context
// cl_context context;
// cl_context_properties contextProperties[] =
// { CL_CONTEXT_PLATFORM, (cl_context_properties)platformID, 0 };
// context = clCreateContext(contextProperties, 1, &deviceID, NULL, NULL, NULL);
//
// // Create a command queue
// cl_command_queue queue;
// queue = clCreateCommandQueue(context, deviceID, CL_QUEUE_PROFILING_ENABLE, NULL);
//
// // Create an OpenCL program
// std::string source = FileToString("../kernels/programs.cl");
// const char* csource = source.c_str();
// cl_program program = clCreateProgramWithSource(context, 1, &csource, NULL, NULL);
// cl_int err = clBuildProgram(program, 1, &deviceID, NULL, NULL, NULL);
// if (err != CL_SUCCESS)
// {
// cl_uint logLength;
// clGetProgramBuildInfo(program, deviceID, CL_PROGRAM_BUILD_LOG, 0, NULL, &logLength);
// char* log = new char[logLength];
// clGetProgramBuildInfo(program, deviceID, CL_PROGRAM_BUILD_LOG, logLength, log, 0);
// std::cout << log << std::endl;
// delete[] log;
// exit(-1);
// }
//}
int main()
{
OpenCLHandler handler;
std::vector<TestCase*> tests;
Square s;
TestCase* t;
t = &s;
tests.push_back(t);
for (size_t i = 0; i < tests.size(); i++) {
handler.run_test(tests[i]);
}
return 0;
}