enum material_type {
DIFFUSE = 0,
};
struct sphere {
material_type type;
};
export uniform float render(uniform sphere spheres[]) {
sphere current_sphere = spheres[0]; // this the offensive line. If I add "uniform" to the type of current_sphere, compilation succeeds.
return 0.0f;
}
with
ispc enum.ispc --target=avx2
Current behaviour
The compilation fails with the error:
/usr/local/src/ispc/src/expr.cpp:6536: Assertion failed: "CastType<PointerType>(type) != NULL".
***
*** Please file a bug report at https://github.com/ispc/ispc/issues
*** (Including as much information as you can about how to reproduce this error).
*** You have apparently encountered a bug in the compiler that we'd like to fix!
***
/usr/local/src/ispc/src/main.cpp(396): FATAL ERROR: Unhandled signal sent to process; terminating.
Aborted (core dumped)
Expected behaviour
Compilation succeeds.
Other comment
In the above example it may seem that I could make spheres uniform but in my actual code, I get different indices depending on the gang's previous computation.
FWIW, I'm working around the issue by using int instead of an enum, i.e.
Steps to reproduce
Compile the following code (enum.ispc):
with
Current behaviour
The compilation fails with the error:
Expected behaviour
Compilation succeeds.
Other comment
In the above example it may seem that I could make
spheres
uniform but in my actual code, I get different indices depending on the gang's previous computation.FWIW, I'm working around the issue by using
int
instead of an enum, i.e.Environment
Ubuntu 20.04 with ispc 1.17.0: