juan
juan

Reputation: 53

Debugging OpenCL kernel in FPGA Arria 10

I am trying to debug a OpenCL kernel for a Arria 10 FPGA board.

First I am compiling for emulation with:

$ aoc -march=emulator device/kernel.cl -v -o bin/kernel.aocx

And then I can execute the host with the recommended command and works fine:

$ env CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1 ./host

But when I want to debug I do:

$ gdb host
$ (gdb) run

which gives me the error:

Context callback: Program was compiled for a different board.
       aocx is for board EmulatorDevice whereas device is alaric_v3_prod_hpc

I suppose this error is because I am not including the information in "env CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1". How should I execute the host program for debugging? Thanks

Upvotes: 1

Views: 189

Answers (1)

doqtor
doqtor

Reputation: 8494

Prepend gdb call with env flag, same like you did without debugging:

env CL_CONTEXT_EMULATOR_DEVICE_ALTERA=1 gdb ./host

Upvotes: 1

Related Questions