Couple things here:
Yeah, we are behind on docs. We know, we've been busy. It's on my agenda for the relatively near future.
FS is intended as a more restrictive variant of RS that enables additional optimization opportunities for compiler backends. We don't have any of those in our CPU backend today that aren't available from equivalent RS files, but it is possible that an OEM may improve performance on their SoCs with FS files versus generic RS files. In general, it requires __attribute__((kernel))
, no pointers, and no unions, and fp_relaxed is implied by the file type.
The host-side API is completely identical; the only difference is in what we actually pass around as the kernel binaries.
Some minor corrections to ofp's answer:
- You should be using rsGetElementAt_(type). It's significantly cleaner than rsGetElementAt because you don't need casting or additional dereferencing or anything like that.
- #pragma fp_relaxed is implied from the .fs extension and is not necessary in FS files.
- You don't have to include rs_allocation.rsh (it's implied as well for all RS/FS files).