Morgan_272
04-Jun-2010, 14:16
Hi
I'm trying to do computations with double precision floats. I have figured out how to enable them - but the code will not compile if I try to use any of the built in math functions on these variables :S
I am running on an AMD Phenom3 CPU, with a Gigabyte Radeon HD5870.
See below code for an example:
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
kernel void TestAll(global write_only double* a)
{
int index = get_global_id(0);
double x, y;
x = trunc(index / pow(4, 2));
y = trunc(index / 4) - (x * 4);
a[index] = hypot(x, y);
}
When my app executes the kernel it crashes, if I analyze the above code using Kernel StreamAnalyzer 1.5, I get the following compile error:
OpenCL Compile Error: clBuildProgram failed (CL_BUILD_PROGRAM_FAILURE).
Error: Undeclared function index 1207
If anyone could tell me how to fix / get round this issue I would be most gratefull.
Thank you!
I'm trying to do computations with double precision floats. I have figured out how to enable them - but the code will not compile if I try to use any of the built in math functions on these variables :S
I am running on an AMD Phenom3 CPU, with a Gigabyte Radeon HD5870.
See below code for an example:
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
kernel void TestAll(global write_only double* a)
{
int index = get_global_id(0);
double x, y;
x = trunc(index / pow(4, 2));
y = trunc(index / 4) - (x * 4);
a[index] = hypot(x, y);
}
When my app executes the kernel it crashes, if I analyze the above code using Kernel StreamAnalyzer 1.5, I get the following compile error:
OpenCL Compile Error: clBuildProgram failed (CL_BUILD_PROGRAM_FAILURE).
Error: Undeclared function index 1207
If anyone could tell me how to fix / get round this issue I would be most gratefull.
Thank you!