summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/OpenCL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/OpenCL.cpp')
-rw-r--r--Source/Core/Common/Src/OpenCL.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp
index 451d43ab48..c1a6e7166b 100644
--- a/Source/Core/Common/Src/OpenCL.cpp
+++ b/Source/Core/Common/Src/OpenCL.cpp
@@ -78,7 +78,8 @@ bool Initialize()
}
char pbuf[100];
- err = clGetPlatformInfo(platforms[0], CL_PLATFORM_VENDOR, sizeof(pbuf), pbuf, NULL);
+ err = clGetPlatformInfo(platforms[0], CL_PLATFORM_VENDOR, sizeof(pbuf),
+ pbuf, NULL);
if (err != CL_SUCCESS)
{
@@ -95,7 +96,8 @@ bool Initialize()
return false;
}
- cl_context_properties cps[3] = {CL_CONTEXT_PLATFORM, (cl_context_properties)platform, 0};
+ cl_context_properties cps[3] = {CL_CONTEXT_PLATFORM,
+ (cl_context_properties)platform, 0};
cl_context_properties* cprops = (NULL == platform) ? NULL : cps;
@@ -143,9 +145,10 @@ cl_command_queue GetCommandQueue()
cl_program CompileProgram(const char *Kernel)
{
u32 compileStart = Common::Timer::GetTimeMs();
- int err;
+ cl_int err;
cl_program program;
- program = clCreateProgramWithSource(OpenCL::g_context, 1, (const char **) & Kernel, NULL, &err);
+ program = clCreateProgramWithSource(OpenCL::g_context, 1,
+ (const char **) & Kernel, NULL, &err);
if (!program)
{
HandleCLError(err, "Error: Failed to create compute program!");
@@ -156,13 +159,14 @@ cl_program CompileProgram(const char *Kernel)
err = clBuildProgram(program , 0, NULL, NULL, NULL, NULL);
if(err != CL_SUCCESS) {
char *errors[16384] = {0};
- err = clGetProgramBuildInfo(program, OpenCL::device_id, CL_PROGRAM_BUILD_LOG, sizeof(errors),
- errors, NULL);
- ERROR_LOG(COMMON, "Error log:\n%s\n", errors);
+ err = clGetProgramBuildInfo(program, OpenCL::device_id,
+ CL_PROGRAM_BUILD_LOG, sizeof(*errors), errors, NULL);
+ ERROR_LOG(COMMON, "Error log:\n%s\n", *errors);
return NULL;
}
- NOTICE_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds", (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
+ NOTICE_LOG(COMMON, "OpenCL CompileProgram took %.3f seconds",
+ (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return program;
}
@@ -180,7 +184,8 @@ cl_kernel CompileKernel(cl_program program, const char *Function)
HandleCLError(err, buffer);
return NULL;
}
- NOTICE_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds", (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
+ NOTICE_LOG(COMMON, "OpenCL CompileKernel took %.3f seconds",
+ (float)(Common::Timer::GetTimeMs() - compileStart) / 1000.0);
return kernel;
}
#endif