On 6/21/23 18:19, Li, Pan2 wrote:
Hi there,
I try to verify the offloading following below doc.
https://gcc.gnu.org/wiki/Offloading#How_to_build_an_offloading-enabled_GCC
with some steps:
1. Build nvptx-tools.
2. Symbol link nvptx-newlib to gcc source code.
3. Build the Nividia PTX accel compiler.
4. Build the host compiler with nvptx as offload target, but I don't have the
GPU, then drop the --with-cuda-driver=xxx option.
5. Run command for building, aka ./nvptx-tools/usr/local/bin/gcc -O0 -fopenmp
test.c -o test.elf.
The building complete successfully, but looks I cannot run it without GPU, and
I am not very sure this is good enough for validation or not.
If you don't have a suitable GPU for offloading, you could instead just
compare the offloaded binary before/after your change. I would expect
them to be 100% identical.
If we take that route for verification, I think the question turns into
how to do that for the testsuite. ie, I think Jakub wants to verify
that check-target-libgomp still passes when offloading is enabled. I
don't think there's an easy way to capture the resulting binaries for
comparison purposes. But that's what I'd suggest given the lack of a
suitable GPU for testing. So you might need to hack up the libgomp
testsuite's .exp files to capture the binaries.
Before going to those extremes, I would suggest verifying that you do in
fact get identical binaries before/after your change on a simple
offloading test.
jeff