- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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; }Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Is it compulsory for the loop bound to be constant for unrolling? --- Quote End --- No. However, for minimum area overhead and maximum performance, it is best if the loop bound is known at compile-time and is divisible by the unroll factor. --- Quote Start --- Would the below kernel generate 50 times hw replication? What will happen if host sets the k = 60? --- Quote End --- The compiler will create a pipeline that can process 50 iteration per clock by using more FPGA resources. If you set k = 60, then the pipeline will work for two clocks + pipeline latency; nothing will go wrong, just the pipeline utilization will be low in the last clock. ...

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page