Skip to content

Commit

Permalink
[Ada] Improve CUDA host-side and device-side binder support
Browse files Browse the repository at this point in the history
On the host-side, the binder now generates CUDA_Execute pragmas to
invoke initialization and finalization on the device-side. The
front end's expansion of these pragmas includes references to
entities declared in package CUDA.Internal. Generate a with-clause so
that unit will be available.

gcc/ada/

	* bindgen.adb: When the binder is invoked for the host, generate a
	"with CUDA.Internal;" with clause.
  • Loading branch information
swbaird authored and marc-adacore committed Sep 12, 2022
1 parent f64bfc1 commit bd548d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gcc/ada/bindgen.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,9 @@ package body Bindgen is
if Enable_CUDA_Expansion then
WBI ("with Interfaces.C;");
WBI ("with Interfaces.C.Strings;");

-- with of CUDA.Internal needed for CUDA_Execute pragma expansion
WBI ("with CUDA.Internal;");
end if;

Resolve_Binder_Options (Elab_Order);
Expand Down

0 comments on commit bd548d6

Please sign in to comment.