Hi everybody,
I got a bug report from a Linux user that my program crashes. Using the log I was able to identify the problem: some OpenCL code fails to compile. But I can’t see any problems with the code. It also runs on many other platform/OS and device combinations without problems.
clBuildProgram() fails with CL_OUT_OF_RESOURCES and clGetProgramBuildInfo() returns nothing (empty string).
Could you, please, help me? Have you ever come across something similar?
Thanks,
Martin
This is the code that fails to compile:
// Multiplies two complex numbers.
inline float2 complexMultiply(float2 a, float2 b)
{
return (float2)(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x);
}
// Multiplies the complex numbers in a by corresponding elements in b.
// This effectively performs circular convolution in the frequency domain.
__kernel void filter(__global float2* a, __global float2* b)
{
int id0 = get_global_id(0);
int id1 = get_global_id(1);
int size0 = get_global_size(0);
int id = id1*size0 + id0;
a[id] = complexMultiply(a[id], b[id0]);
}
// Assigns zero to all elements.
__kernel void zero(__global float* a)
{
int id0 = get_global_id(0);
a[id0] = 0;
}
The user’s system:
OpenCL info:
Selected platform: NVIDIA CUDA
Version: OpenCL 1.2 CUDA 9.1.84
OpenGL info:
Version: 4.6.0 NVIDIA 390.25
Renderer: GeForce GTX 465/PCIe/SSE2