OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

initializer element IS a compile-time constant

popog
Beginner
2,046 Views
Why does one line fail while the other succeeds.
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
constant unsigned const precision = 3;
constant unsigned const preciselyu = 1 << precision;
constant double const preciselyd = (double)(preciselyu);
constant double const ipreciselyd = 1.0 / preciselyd; // FAILS "error: initializer element is not a compile-time constant"
constant double const ipreciselyd = 1.0 / (double)(preciselyu); // WORKS
0 Kudos
1 Solution
Shiri_M_Intel
Employee
2,046 Views
Hi

Thanks for reporting this issue. We identified the root cause of this topic.

It will be fixed in future versions.
Thanks, Shiri

View solution in original post

0 Kudos
1 Reply
Shiri_M_Intel
Employee
2,047 Views
Hi

Thanks for reporting this issue. We identified the root cause of this topic.

It will be fixed in future versions.
Thanks, Shiri

0 Kudos
Reply