Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Error when specifying max work group size

Altera_Forum
Honored Contributor II
2,457 Views

Hi everyone, 

 

I just find out that whenever I try to add max_work_group_size(X, Y, Z) attribute to a kernel I get the following error: 

 

"error: attribute takes one argument" 

 

Not even the example supplied by the programming guide compiles: 

 

"aoc -v -c sum.claoc: Environment checks are completed successfully. 

aoc: Selected target board de5net_a7 

aoc: Running OpenCL parser.... 

c:/Users/RT/Desktop/sum.cl:1:16: error: attribute takes one argument 

__attribute__((max_work_group_size(64,1,1))) 

1 error generated. 

Error: OpenCL parser FAILED. 

Refer to sum/sum.log for details." 

 

Where the ^ pointer points at letter 'm' of "max_work_group_size". 

This is the source code from the example by the way: 

 

"__attribute__((max_work_group_size(64,1,1))) 

__kernel void sum (__global const float * restrict a, 

__global const float * restrict b, 

__global float * restrict answer) 

size_t gid = get_global_id(0); 

answer[gid] = a[gid] + b[gid]; 

}" 

 

This happens on both Linux and windows version 15 of AOCL, but "reqd_work_group_size(X, Y, Z)" works just fine. 

 

I don't know if this is a bug of the compiler or am I missing something? 

 

Thanks in advance!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,398 Views

Hi, 

the syntax of the attribute should be __attribute__((max_work_group_size(SIZE)),so just one argument as the compiler error suggested. 

 

Cheers, 

Sergio
0 Kudos
Altera_Forum
Honored Contributor II
1,398 Views

Thanks Sergio! I discovered this sometime ago but I forgot to update the thread... 

 

Cheers, 

Ryan
0 Kudos
Reply