Mercurial > hg > Members > yutaka > OpenCL
diff WordCount/oclUtils.cc @ 1:403e35dd9b6d
word count ...
author | Yutaka_Kinjyo |
---|---|
date | Tue, 12 Jul 2011 17:17:11 +0900 |
parents | 0e6e76dbdb0f |
children |
line wrap: on
line diff
--- a/WordCount/oclUtils.cc Tue Jul 12 11:12:51 2011 +0900 +++ b/WordCount/oclUtils.cc Tue Jul 12 17:17:11 2011 +0900 @@ -83,3 +83,19 @@ return (index >= 0 && index < errorCount) ? errorString[index] : "Unspecified Error"; } +////////////////////////////////////////////////////////////////////////////// +//! Get and log the binary (PTX) from the OpenCL compiler for the requested program & device +//! +//! @param cpProgram OpenCL program +//! @param cdDevice device of interest +////////////////////////////////////////////////////////////////////////////// +void oclLogBuildInfo(cl_program cpProgram, cl_device_id cdDevice) +{ + // write out the build log and ptx, then exit + char cBuildLog[10240]; + clGetProgramBuildInfo(cpProgram, cdDevice, CL_PROGRAM_BUILD_LOG, + sizeof(cBuildLog), cBuildLog, NULL ); + //shrLog("\n%s\nBuild Log:\n%s\n%s\n", HDASHLINE, cBuildLog, HDASHLINE); + printf("Build Log:\n%s\n", cBuildLog); +} +