Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

Any OpenCL Debugging Tools?

I have one OpenCL code which runs well on CPU/GPU, but fail to run through on FPGA.

Are there any OpenCL Debugging Tools available to read out the inner status over JTAG?

The code: (with initialized global_offset[0] = 0, and global size is 128)

__kernel void global_atomic_sequential_write(__global int *global_offset, int num_elem)

{

const unsigned int global_id = get_global_id(0);

bool DoWork = false;

while (!DoWork)

{

DoWork = atomic_cmpxchg(&global_offset[0], 0, 1) == 0;

}

global_offset[0] = 0;

}

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    At the moment there are no tools but you can use printf to push data back to the host. You'll want to put a guard statement around the printf so that you only get data back from a single work-item (if you don't you'll end up with printf executed by all the work-items and it'll be fairly difficult to decypher).