dschwen

clBuildProgram fails with std::length_error

Discussion created by dschwen on Aug 13, 2010
Latest reply on Aug 18, 2010 by MicahVillmow

 

After minute changes on my kernel source - namely replacing float4 with float3 - my program suddenly crashes with

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create

when I call clBuildProgram.
Just verified that the error vanishes if i replace all occurrences of float3 with float4 (like it used to be). It is the same project I mentiond in the "Erratic freezes" thread.
What is going on here?

The difference boils down to:

 

__kernel void mu3d(  float4 Eax, float4 Ebx, float4 Evx, float4 Exx, float4 Ex, float zz, float ddzn, float ncd2,
                     __global float *cA, __global float *cV, __global float *ccv,
                     __global float4 *u,
                     __local float3 *cn )

vs.
__kernel void mu3d(  float3 Eax, float3 Ebx, float3 Evx, float3 Exx, float3 Ex, float zz, float ddzn, float ncd2,
                     __global float *cA, __global float *cV, __global float *ccv,
                     __global float4 *u,
                     __local float3 *cn )

 

float4 version works, float3 version build fails.

Outcomes