Dynamic allocation of SOA type.

51 views
Skip to first unread message

Alex Yuan

unread,
Oct 24, 2019, 12:08:35 PM10/24/19
to Intel SPMD Program Compiler Users
Hi,

Can anyone kindly let me know how I can dynamically allocate SOA types?

Following is an example test.ispc:

struct anything {
    int start;
    int end;
};

static void
process_items(uniform const float input[],
              uniform int height, uniform int width,
              soa<8> anything a[])
{
}

export void
process_ispc(uniform const float input[],
             uniform int height, uniform int width)
{
    uniform const int length = height * width;
    soa<8> anything * uniform a = uniform new soa<8> anything[length];
    process_items(input, height, width, a);
    delete a;
}

This is the command line and error message:
$ ../bin/ispc.exe --arch=x86 --target=avx2-i32x8 -o test.obj test.ispc
Assertion failed: castIsValid(getOpcode(), S, Ty) && "Illegal BitCast", file c:\iusers\aneshlya\llvm_release\llvm-8.0\llvm\lib\ir\instructions.cpp, line 3268

I was using a prebuilt v1.12.0 Windows build if that matters.

Regards,
Alex

Dmitry Babokin

unread,
Oct 28, 2019, 2:25:35 AM10/28/19
to ispc-...@googlegroups.com
Hi Alex,

soa<> support is quite buggy, this is yet another problem in the collection of soa<> problems. We need either to solve them at once or deprecate soa<> support. Could you please file an issue with this problem?

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/d0aa310b-66f9-4a39-9165-1bc6734ba6c4%40googlegroups.com.

Brian

unread,
Nov 3, 2019, 3:28:44 PM11/3/19
to Intel SPMD Program Compiler Users
My 2 cents: I'd suggest working with "varying float" and "varying anything" rather than 'soa<8> float' and 'soa<8> anything'.

-Brian
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages