0

我尝试在我的 OpenCL 内核中使用双精度扩展,但它不会构建。(Cloo.BuildProgramFailureComputeException)

这是我的代码:

string kernel = @"
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
kernel void ImgWarp(
    global char* img1,
    global char* img2)
    { }"

ComputeContextPropertyList Properties = new ComputeContextPropertyList(ComputePlatform.Platforms[0]);
ComputeContext context = new ComputeContext(ComputeDeviceTypes.All, Properties, null, IntPtr.Zero);
ComputeProgram program = new ComputeProgram(context, kernel);
program.Build(null, null, null, IntPtr.Zero);

我检查了我的硬件是否支持双精度,它确实支持。但是,使用 cl_amd_printf 扩展是可行的。有任何想法吗?

4

1 回答 1

0

调试此类问题应该做的第一件事是使用带有 CL_PROGRAM_BUILD_LOG 的 clGetProgramBuildInfo 获取构建日志。在那里,您应该看到有关该问题的一些信息。你也试过 cl_amd_fp64 吗?

于 2011-07-18T16:01:10.220 回答