我在NetBeans编译器的人脸识别系统上的Java代码项目中遇到以下错误。
编译失败 CLDevice [id:669064192名称:Intel(R)HD Graphics 520类型:GPU配置文件:FULL_PROFILE]构建日志: 2:85:29:错误:标量操作数类型的秩比矢量元素的类型大。 (“ double”和“ float4”(4个“ float”值的向量)) float4 rgb =(1.0 / 256.0)(S(x2-2,y2-2)+ S(x2 + 2,y2-2)+ S(x2-2,y2 + 2)+ S(x2 + 2 ,y2 + 2))+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ 2:86:29:错误:标量操作数类型的秩比矢量元素的类型大。 (“ double”和“ float4”(4个“ float”值的向量)) (4.0 / 256.0)(S(x2-1,y2-2)+ S(x2 + 1,y2-2)+ S(x2-2,y2-1)+ S(x2 + 2,y2 -1)+
这里是产生错误的代码。
public CLKernel buildKernel(String compilerOptions, String resourceNames, String kernelName) {
return buildKernels(compilerOptions, Loader.getCallerClass(2), resourceNames, kernelName)[0];
}
public CLKernel[] buildKernels(String compilerOptions, String resourceNames, String ... kernelNames) {
return buildKernels(compilerOptions, Loader.getCallerClass(2), resourceNames, kernelNames);
}
public CLKernel[] buildKernels(String compilerOptions, Class resourceClass, String resourceNames, String ... kernelNames) {
try {
//load and compile program for the chosen device
InputStream s;
String[] a = resourceNames.split(":");
if (a.length == 1) {
s = resourceClass.getResourceAsStream(a[0]);
} else {
Vector<InputStream> vs = new Vector<InputStream>(a.length);
for (String name : a) {
vs.addElement(resourceClass.getResourceAsStream(name));
}
s = new SequenceInputStream(vs.elements());
}