mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-08 05:50:07 -05:00
Show opencl program build errors on info tab, when compilation fails
This commit is contained in:
parent
c01f444d52
commit
582bd93dea
@ -1130,6 +1130,7 @@ uint OpenCLWrapper::DeviceIndex() const { return m_DeviceIndex; }
|
|||||||
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
|
size_t OpenCLWrapper::GlobalMemSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_GLOBAL_MEM_SIZE); }
|
||||||
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
uint OpenCLWrapper::LocalMemSize() const { return m_LocalMemSize; }
|
||||||
size_t OpenCLWrapper::MaxAllocSize() const { return GetInfo<cl_ulong>(PlatformIndex(), DeviceIndex(), CL_DEVICE_MAX_MEM_ALLOC_SIZE); }
|
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>
|
/// <summary>
|
||||||
/// Makes the even grid dims.
|
/// Makes the even grid dims.
|
||||||
@ -1242,6 +1243,9 @@ bool OpenCLWrapper::CreateSPK(const string& name, const string& program, const s
|
|||||||
|
|
||||||
if (CheckCL(err, "cl::Kernel()"))
|
if (CheckCL(err, "cl::Kernel()"))
|
||||||
return true;//Everything is ok.
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,6 +192,7 @@ public:
|
|||||||
uint LocalMemSize() const;
|
uint LocalMemSize() const;
|
||||||
size_t GlobalMemSize() const;
|
size_t GlobalMemSize() const;
|
||||||
size_t MaxAllocSize() const;
|
size_t MaxAllocSize() const;
|
||||||
|
std::vector<std::string> ProgramBuildErrors() const;
|
||||||
|
|
||||||
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
static void MakeEvenGridDims(uint blockW, uint blockH, uint& gridW, uint& gridH);
|
||||||
|
|
||||||
@ -217,5 +218,6 @@ private:
|
|||||||
std::vector<NamedBuffer> m_Buffers;
|
std::vector<NamedBuffer> m_Buffers;
|
||||||
std::vector<NamedImage2D> m_Images;
|
std::vector<NamedImage2D> m_Images;
|
||||||
std::vector<NamedImage2DGL> m_GLImages;
|
std::vector<NamedImage2DGL> m_GLImages;
|
||||||
|
std::vector<std::string> m_programBuildErrors;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1276,7 +1276,11 @@ int RendererCL<T>::MakeAndGetFinalAccumProgram(T& alphaBase, T& alphaScale)
|
|||||||
if (b)
|
if (b)
|
||||||
kernelIndex = m_Wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
kernelIndex = m_Wrapper.FindKernelIndex(finalAccumEntryPoint);//Try to find it again, it will be present if successfully built.
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
std::vector<std::string> errors = m_Wrapper.ProgramBuildErrors();
|
||||||
|
m_ErrorReport.insert(m_ErrorReport.end(), errors.begin(), errors.end());
|
||||||
m_ErrorReport.push_back(loc);
|
m_ErrorReport.push_back(loc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return kernelIndex;
|
return kernelIndex;
|
||||||
|
Loading…
Reference in New Issue
Block a user