我正在尝试为我的方法创建一个标识符。这个标识符对我的工作很重要,因为它实际上是硬件综合。
我有以下模板类:
template <int FF_COUNT, int FB_COUNT, int NEXT_COUNT>
class Core{
public:
...
template<int id> void consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]);
}
template <int FF_COUNT, int FB_COUNT, int NEXT_COUNT>
template <int id>
void Core<FF_COUNT, FB_COUNT, NEXT_COUNT>::consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]){
#pragma HLS INLINE off
event e;
for(int i = 0 ; i < FB_COUNT ; i++) {
while (!feedback_stream[id][i].empty()) {
feedback_stream[id][i].read(e);
ap_uint<16> mem_offset = e << size_exp;
consume_event (e, mem_offset, w_mem);
}
}
}
这是我的函数调用
#define sth 8
for int i = 0 ; i < sth; i++
core[i].consume_fb_events<i>(....);
我得到编译错误:
ERROR: [HLS 200-70] Compilation errors found: In file included from c1/srnn.cpp:1:
c1/srnn.cpp:197:14: error: no matching member function for call to 'consume_fb_events'
core_1[i].consume_fb_events<i>(buffer_layer1_1, w1[i]);
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
c1/core.h:52:24: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'id'
template<int id> void consume_fb_events (hls::stream<event> feedback_stream [FB_COUNT] [FB_COUNT], weight w_mem [128*128]);
^