Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17056 Discussions

Are templates in OpenCL Kernels supported somehow

Altera_Forum
Honored Contributor II
2,088 Views

I am installing Caffe but want to use FPGA acceleration instead of GPU. However, I get an error when compiling. 

I am assuming that Altera's aoc doesn't handle templates (yet). 

 

Anyway around this? templates coming soon? already there but "template __attribute" 

 

 

 

template <class T> 

__kernel void BNLLForward(const int n, __global const T* in, __global T* out) { 

int index = get_global_id(0); 

if (index < n) { 

out[index] = in[index] > 0 ? in[index] + log(1. + exp(-in[index])) : log(1. + exp(in[index])); 

template __attribute__((mangled_name(BNLLForward_float))) __kernel void BNLLForward(const int n, __global const float* in, __global float* out); 

template __attribute__((mangled_name(BNLLForward_double))) __kernel void BNLLForward(const int n, __global const double* in, __global double* out); 

 

 

========yields the following errors========== 

 

 

/home/poz/altera/Caffe/OpenCL-caffe-stable/src/caffe/ocl/bnll_layer.cl:29:1: error: unknown type name 'template' 

template <class T> 

/home/poz/altera/Caffe/OpenCL-caffe-stable/src/caffe/ocl/bnll_layer.cl:37:1: error: unknown type name 'template' 

template __attribute__((mangled_name(BNLLForward_double))) __kernel void BNLLForward(const int n, __global const double* in, __global double* out); 

 

 

Thanks in advance (I hope) 

 

Dan..
0 Kudos
0 Replies
Reply