2013-04-17 21:09:55 -06:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2010-02-19 10:05:26 -07:00
|
|
|
|
|
|
|
#ifndef __OPENCL_H__
|
|
|
|
#define __OPENCL_H__
|
|
|
|
|
|
|
|
#include "Common.h"
|
2010-07-10 15:17:08 -06:00
|
|
|
|
2010-10-24 14:07:12 -06:00
|
|
|
#ifdef __APPLE__
|
2011-01-05 18:11:32 -07:00
|
|
|
#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
2010-10-24 14:07:12 -06:00
|
|
|
#include <OpenCL/cl.h>
|
|
|
|
#else
|
2011-01-05 18:11:32 -07:00
|
|
|
// The CLRun library provides the headers and all the imports.
|
2010-02-19 10:05:26 -07:00
|
|
|
#include <CL/cl.h>
|
2011-01-05 18:11:32 -07:00
|
|
|
#include <clrun.h>
|
2010-02-19 10:05:26 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
namespace OpenCL
|
|
|
|
{
|
|
|
|
|
|
|
|
extern cl_device_id device_id;
|
|
|
|
extern cl_context g_context;
|
|
|
|
extern cl_command_queue g_cmdq;
|
|
|
|
|
|
|
|
bool Initialize();
|
|
|
|
|
|
|
|
cl_context GetContext();
|
|
|
|
|
|
|
|
cl_command_queue GetCommandQueue();
|
|
|
|
|
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
cl_program CompileProgram(const char *Kernel);
|
|
|
|
cl_kernel CompileKernel(cl_program program, const char *Function);
|
|
|
|
|
2010-05-26 16:40:06 -06:00
|
|
|
void HandleCLError(cl_int error, const char* str = 0);
|
2010-02-19 10:05:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|