KastnerRG / spector

Spector: An OpenCL FPGA Benchmark Suite
Other
43 stars 17 forks source link

Compiler Error for 3_estimateResults.py in mergesort/scripts #3

Open TomLight343 opened 7 years ago

TomLight343 commented 7 years ago

/home/mnelson/Spector/mergesort/benchmarks/merge_design273/mergesort.cl:112:15: error: local variables are allowed only at kernel scope local data_t localdata1[LOCAL_SORT_SIZE]; ^ /home/mnelson/Spector/mergesort/benchmarks/merge_design273/mergesort.cl:113:15: error: local variables are allowed only at kernel scope local data_t localdata2[LOCAL_SORT_SIZE];

A similar pair of error messages occurs for every benchmark when the 3rd script is run.

qkgautier commented 7 years ago

For which benchmark does this happen? Your example shows mergesort, but I cannot reproduce this error. Can you give me more details about your system and the AOC version you're using?

TomLight343 commented 7 years ago

Oh forgive me, it was mergesort.

TomLight343 commented 7 years ago

I'll mess with it for a little bit and get back to you.

TomLight343 commented 7 years ago

I'm using aocl 16.1.0.196 Intel FPGA SDK. The target board is a Terasic DE1-SoC.

qkgautier commented 7 years ago

This is interesting. I can reproduce the error with the DE1 BSP, but not with the DE5 BSP. More interestingly, the Intel OpenCL compiler gives me an error too, but not the NVIDIA compiler.

I think some compilers cannot handle declaring a __local variable within a function, for loop, or similar scope. The solution would be to declare the local variables at kernel scope, and pass them to the function. But I'd have to double check if this causes dependency issues and possibly synchronization issues for certain combination of knobs.

I can take a look, but that will take a while as I'm pretty busy right now. Meanwhile you can try to implement what I mentioned, but I cannot guarantee that the results will be correct.