Skip to content

Commit

Permalink
Make GPU library tests respect CXXFLAGS (chapel-lang#26108)
Browse files Browse the repository at this point in the history
Adjusts a test locking in GPU library behavior to respect CXXFLAGS.

This was preventing this test from running properly on some systems
where extra flags set in CXXFLAGS are required for GPU compilation.

Note that this PR has no changes to the cmake version of this test, as
cmake was automatically respecting CXXFLAGS (as it should)

[Reviewed by @e-kayrakli]
  • Loading branch information
jabraham17 authored Oct 17, 2024
2 parents d68e597 + 23456fe commit d651390
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/gpu/native/interop/gpuLibrary/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include lib/Makefile.udf2
test_udf2_make_cpu: test_udf2.cpp lib/libudf2.a
@$(CHPL_COMPILER) -x c++ -lstdc++ $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)
@$(CHPL_COMPILER) -x c++ -lstdc++ $(CXXFLAGS) $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)

test_udf2_make_nvidia: test_udf2.cpp lib/libudf2.a
@$(CHPL_COMPILER) -x cuda -lstdc++ $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)
@$(CHPL_COMPILER) -x cuda -lstdc++ $(CXXFLAGS) $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)

test_udf2_make_amd: test_udf2.cpp lib/libudf2.a
@$(CHPL_COMPILER) -x hip -lstdc++ $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)
@$(CHPL_COMPILER) -x hip -lstdc++ $(CXXFLAGS) $(CHPL_CFLAGS) -o test_udf2_make $< $(CHPL_LDFLAGS)

2 changes: 1 addition & 1 deletion test/gpu/native/interop/gpuLibrary/udf2.prediff
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [[ "$chpl_gpu" == "nvidia" ]]; then
elif [[ "$chpl_gpu" == "amd" ]]; then
gpu_flags="-x hip"
fi
$cxx $gpu_flags test_udf2.cpp -Ilib -Llib/ -ludf2 $libs -o test_udf2_compileline
$cxx $CXXFLAGS $gpu_flags test_udf2.cpp -Ilib -Llib/ -ludf2 $libs -o test_udf2_compileline
echo "Running test_udf2_compileline" >> $OUTFILE
./test_udf2_compileline >> $OUTFILE

Expand Down

0 comments on commit d651390

Please sign in to comment.