In renderscript kernels has to be defined in separate .rs
files as follows:
float __attribute__((kernel)) foo_1(uint32_t x) {
}
float __attribute__((kernel)) foo_2(uint32_t x) {
}
Then it has to be used in the main java file as follows:
ScriptC_fileName tmp = new ScriptC_fileName(rs);
I was wondering which of the following is the best programming practice for performance and why.
- Defining all kernels in the same
.rs
file. - Using separate
.rs
files for different kernels.