2013-04-18 06:09:55 +03:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2010-02-19 19:05:26 +02:00
|
|
|
|
|
|
|
#ifndef __OPENCL_H__
|
|
|
|
#define __OPENCL_H__
|
|
|
|
|
|
|
|
#include "Common.h"
|
2010-07-11 00:17:08 +03:00
|
|
|
|
2010-10-24 23:07:12 +03:00
|
|
|
#ifdef __APPLE__
|
2011-01-06 03:11:32 +02:00
|
|
|
#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
2010-10-24 23:07:12 +03:00
|
|
|
#include <OpenCL/cl.h>
|
|
|
|
#else
|
2011-01-06 03:11:32 +02:00
|
|
|
// The CLRun library provides the headers and all the imports.
|
2010-02-19 19:05:26 +02:00
|
|
|
#include <CL/cl.h>
|
2011-01-06 03:11:32 +02:00
|
|
|
#include <clrun.h>
|
2010-02-19 19:05:26 +02: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-27 01:40:06 +03:00
|
|
|
void HandleCLError(cl_int error, const char* str = 0);
|
2010-02-19 19:05:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|