Introduction
An .ispc file holds a program for ISPC, the Intel SPMD Program Compiler.
SPMD stands for single program, multiple data: the code is written as if for one
instance, and the compiler runs many instances at once in the vector units of a
processor. The language is based on C, with a few added keywords, and the compiler
is open source under the BSD-3-Clause licence. Its targets include x86 processors
from SSE2 to AVX-512, ARM NEON and Intel Xe graphics.
ISPC is not a shader language in the graphics sense, but its programs have the same
data-parallel shape as CUDA and
OpenCL C kernels, which is why it is listed here. The
compiler writes an object file, and with -h a C header, which an ordinary
C or C++ program links against and calls.
Structure
A function that C code can call is marked export. The qualifier
uniform marks a value that is the same in all instances, and
varying one that differs from instance to instance. A
foreach loop spreads its iterations over the instances.
export void simple(uniform float vin[], uniform float vout[],
uniform int count) {
foreach (index = 0 ... count) {
float v = vin[index];
if (v < 3.)
v = v * v;
else
v = sqrt(v);
vout[index] = v;
}
}
ispc simple.ispc -o simple.o.Not described
Known, not yet covered
- Reference: this overview is the only page. The language has no reference pages: the types and the uniform and varying rules, control flow and its masking, the standard library, tasks and launching them, the pointer and structure layout rules, and the compiler options and targets. The ISPC user guide describes them.
- Viewer: there is no viewer for this format yet, and nothing is compiled or checked.
Links
Software
- ISPC – the open-source compiler (Windows, macOS, Linux)
Reference
- ISPC user guide – the language and the compiler