Thanks for the reply. I filed this issue: https://github.com/ispc/ispc/issues/1309
As an additional note, declaring the constants as uniform is a pretty decent workaround. -Brian On Tuesday, January 23, 2018 at 2:22:39 PM UTC-8, Dmitry Babokin wrote: > > This looks like a correct code to me. The code to check this kind of > things was changed in 1.9.2, but reported behavior is not intended. > > Please file an issue, I'll have a look. > > On Tue, Jan 23, 2018 at 8:14 PM, Brian Green <[email protected] > <javascript:>> wrote: > >> When upgrading to 1.9.2 from 1.9.1 the following code no longer compiles: >> >> inline void someFunc() >> { >> static const float scale = 1.0f / 8.0f; >> static const float halfScale = 0.5f * scale; >> >> // continue.... >> } >> >> producing the error: >> >> Error: Initializer for static variable "halfScale" must be a constant. >> static const float halfScale = 0.5f * scale; >> >> >> The code compiles without error in 1.9.1 and previous versions. Should >> this have always been an error? >> >> -Brian >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Intel SPMD Program Compiler Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
