@@ -58,11 +58,11 @@ second to make the next steps meaningful.
58
58
This code is currently fully native and single treaded. We're going to offload
59
59
the computation to the GPU.
60
60
61
- Open ``src/common/kernel.ads ``. You'll see the specification of ``Native_Complex_Computation ``:
61
+ Open ``src/common/kernel.ads ``. You'll see the specification of ``Complex_Computation ``:
62
62
63
63
.. code-block :: ada
64
64
65
- procedure Native_Complex_Computation
65
+ procedure Complex_Computation
66
66
(A : Float_Array;
67
67
B : Float_Array;
68
68
C : out Float_Array;
@@ -86,8 +86,8 @@ Introduce a new pointer type in the ``Kernel`` package:
86
86
type Array_Device_Access is access Float_Array
87
87
with Designated_Storage_Model => CUDA.Storage_Models.Model;
88
88
89
- Note that this pointer has to be pool specific - e.g. it can't have the ``all ``
90
- Ada reservered word. That means that it conceptually points to a specific
89
+ Note that this pointer has to be pool specific - e.g. it can't be an ``access all ``.
90
+ That means that it conceptually points to a specific
91
91
pool of data - the device memory - and that conversions with other
92
92
pointers types are not allowed.
93
93
@@ -139,7 +139,7 @@ and thread index:
139
139
Note that these are expressed in terms of Interfaces.C.int, so the result
140
140
needs to be converted explicly to Integer.
141
141
142
- From there, the call to ``Native_Complex_Computation `` is trivial. The whole
142
+ From there, the call to ``Complex_Computation `` is trivial. The whole
143
143
kernel should now look like:
144
144
145
145
.. code-block :: ada
@@ -151,7 +151,7 @@ kernel should now look like:
151
151
is
152
152
I : Integer := Integer (Block_Dim.X * Block_IDx.X + Thread_IDx.X);
153
153
begin
154
- Native_Complex_Computation (A.all, B.all, C.all, I);
154
+ Complex_Computation (A.all, B.all, C.all, I);
155
155
end Device_Complex_Computation;
156
156
157
157
We're done with the kernel - let's move to the host code. Open ``src/host/main.adb ``.
0 commit comments