openCL"参数不匹配的指令' mov'"错误

时间:2014-10-09 22:19:00

标签: error-handling compilation opencl gpu nvidia

所以我的一个设备(一个Nvidia GeForce GT 650m GPU)不断给我这个奇怪的ptxas应用程序错误说"参数不匹配的指令' mov'当我尝试在该设备上构建cl_program时。它是我的3个设备中唯一一个给我这个错误的设备。我的CPU和其他GPU(Intel HD 4000)根本不会给我这个错误。

这是导致此错误发生的函数示例。它是我在我的一个内核中使用的辅助函数:

//Calculate the dot product of two vectors
float Dot(Vector v1, Vector v2)
{
    return (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
}

首先,我尝试将工作分成这样的东西:

//Calculate the dot product of two vectors)
float Dot(Vector v1, Vector v2)
{
    float a = v1.x*v2.x;
    float b = v1.y*v2.y;
    float c = v1.z*v2.z;
    float result = a + b + c;
    return result;
}

但这也给了我同样的错误。有趣的是,如果我只是设置result = 5.0f并返回它,它会神奇地编译并运行:

//THIS WILL COMPILE AND RUN
float Dot(Vector v1, Vector v2)
{
    float a = v1.x*v2.x;
    float b = v1.y*v2.y;
    float c = v1.z*v2.z;
    float result = 5.0f; //IGNORE THE CALCULATION. JUST MAKE IT 5
    return result;
}

所以我不知道发生了什么。我的点数'功能不是影响但影响其中一种功能的唯一功能。我的Nvidia卡有缺陷吗?

编辑以下是构建失败后从clGetProgramBuildInfo获取的日志:

ptxas application ptx input, line 703; error   : Arguments mismatch for instruction 'mov'
ptxas application ptx input, line 703; error   : Unknown symbol 'LIntersection_2E_n'
ptxas application ptx input, line 703; error   : Label expected for forward reference of     'LIntersection_2E_n'
ptxas fatal   : Ptx assembly aborted due to errors

虽然打印的错误多于“移动”错误。我描述的一个,当我做出上述结果变化= 5.0f;

时,它们都会消失

1 个答案:

答案 0 :(得分:0)

根据LLVM开发人员的说法,这是nvptx后端的一个错误。

LLVMdev forum message discussing this error