Hi Tomek, It's definitely a bug. In both cases address of static variable is a constant, so it should work as it works in C. please file bug, we'll fix it.
Dmitry. On Mon, Nov 4, 2019 at 2:15 AM Tomek <[email protected]> wrote: > Hi:) > > I would like to do this: > > /* a simple case */ > > static uniform float a = 1.0; > > static uniform float * uniform pa = &a; /* this fails */ > > > /* here is what I'd really like to do */ > > static const uniform float b[] = {0.}; > > static const uniform float c[] = {0.}; > > static const uniform float * uniform pv[] = {NULL, b, c}; /* this also > fails */ > > When trying to compile, the result is: > > ispc -g --arch=x86-64 --target=sse2,sse4-x2,avx bug7.ispc -o > objs/bug7_ispc.o -h objs/bug7_ispc.h > > *bug7.ispc:3:37: **Error**: Initializer for global variable "pa" must be > a constant.* > > static uniform float * uniform pa = &a; /* this fails */ > > ^^ > > *bug7.ispc:8:46: **Error**: Initializer for global variable "pv" must be > a constant.* > > static const uniform float * uniform pv[] = {NULL, b, c}; /* this also > fails */ > > ^^^^^^^^^^ > Would that be an issue within ISPC, or am I missing something? > Thank you:) > Tomek > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ispc-users/975696c6-d7c4-462e-90c9-fd8b756328cf%40googlegroups.com > <https://groups.google.com/d/msgid/ispc-users/975696c6-d7c4-462e-90c9-fd8b756328cf%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/ispc-users/CACRFwuhH0H5%2B6SxA6yMrT-zPadOUQmODgwRK8eyk2WHMV71T1Q%40mail.gmail.com.
