Altera_Forum
Honored Contributor
7 years agoPragma Unroll with variable loop bound
Is it compulsory for the loop bound to be constant for unrolling?
Would the below kernel generate 50 times hw replication? What will happen if host sets the k = 60? __kernel __attribute__((task)) void test_multiplier(global char *restrict in, global char *restrict weights, global int *restrict out, int k) { int output = 0; #pragma unroll 50 for(int i=0; i<k; i++){ output += in * weights; }