This is commit of Simon Detheridge's pull request "osx-opencl" with a few modifications.

-If we change OpenCLWrapper to capture build log errors, we don't need to manually concat them in RendererCL because the overridden ErrorReport() function already concatenates the errors from both classes.

-Do not define T in OpenCL programs. We already have real_t to handle this.

-Do keep the casting to real_t. However this should not be necessary because there is a command line option to do this automatically which we already use: -cl-single-precision-constant. The only reason we do this is because the Apple OpenCL compiler does not follow the standard and obviously ignores this option. Absolutely awful.

-Fix a few improper casts in the CircleTrans1 and GlynnSim1 variations.

-Add an automated OpenCL program build tester to EmberTester, as well as a cast checker.
This commit is contained in:
mfeemster
2015-03-22 12:46:10 -07:00
parent fa6ec63447
commit ef01380e6d
8 changed files with 193 additions and 126 deletions

View File

@ -1130,7 +1130,6 @@ uint OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
size_t OpenCLWrapper::MaxAllocSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
std::vector<std::string> OpenCLWrapper::ProgramBuildErrors() const { return m_programBuildErrors; }
/// <summary>
/// Makes the even grid dims.
@ -1243,9 +1242,11 @@ bool OpenCLWrapper::CreateSPK(const string& name, const string& program, const s
if (CheckCL(err, "cl::Kernel()"))
return true;//Everything is ok.
} else {
for (std::vector<cl::Device>::iterator i = m_DeviceVec.begin(); i != m_DeviceVec.end(); ++ i )
m_programBuildErrors.push_back(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(*i));
}
else
{
for (auto& i : m_DeviceVec)
m_ErrorReport.push_back(spk.m_Program.getBuildInfo<CL_PROGRAM_BUILD_LOG>(i));
}
}