A mishap or a bug in ISPC? (pointer assignment issue)

21 views
Skip to first unread message

Tomek

unread,
Nov 4, 2019, 5:15:43 AM11/4/19
to Intel SPMD Program Compiler Users
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

Dmitry Babokin

unread,
Nov 4, 2019, 1:21:49 PM11/4/19
to ispc-...@googlegroups.com
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.

--
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 ispc-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ispc-users/975696c6-d7c4-462e-90c9-fd8b756328cf%40googlegroups.com.

Tomek

unread,
Nov 5, 2019, 6:00:26 AM11/5/19
to Intel SPMD Program Compiler Users
Thank you:) Done:)
Reply all
Reply to author
Forward
0 new messages