Skip to content

Commit fbeaa88

Browse files
committed
Cleanup todos in OpenCL example program
Some unresolved todos were added to my tracker: #2586
1 parent 021738d commit fbeaa88

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

  • examples/CSharp/OpenCL/Tutorial001.SimpleKernel

‎examples/CSharp/OpenCL/Tutorial001.SimpleKernel/Program.cs‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
// TODO: Exanite: This example is easier to read as a Program class. We should probably do the same for the other examples.
2-
//
3-
// TODO: Exanite: I plan to rename these "tutorials" to be "smoke tests" and to reserve tutorials to be for examples properly designed for educational purposes.
4-
// TODO: Exanite: The existing tutorials just test if the API works and I don't want to misrepresent that.
5-
6-
using System.Runtime.CompilerServices;
1+
using System.Runtime.CompilerServices;
72
using Silk.NET.OpenCL;
83

94
internal unsafe class Program
@@ -69,14 +64,8 @@ __kernel void VectorAdd(__global int* c, __global int* a, __global int* b)
6964

7065
public static int Main(string[] args)
7166
{
72-
// TODO: Exanite: The todos in this file represent issues that I found or thoughts that I had while working on this smoke test.
73-
// TODO: Exanite: These might not represent actual problems, but I want to document these so we can address them later.
74-
7567
// Load API
76-
// TODO: These todos apply to all Silk bindings.
77-
// TODO: Consider making INativeContext public. It's nice for debugging.
78-
// TODO: Consider returning the concrete class instead of the interface. Having to cast to access Cl.CurrentPlatform is annoying.
79-
// TODO: I liked how INativeContext only required the function name in Silk 2. Silk 3 is currently `LoadFunction(functionName, libraryNameHint)`.
68+
// TODO: Expose Cl.CurrentPlatform through the interface.
8069
var cl = Cl.Create(); // TODO: This should be disposable
8170

8271
// Initialize host data
@@ -93,9 +82,8 @@ public static int Main(string[] args)
9382
}
9483

9584
// Select platform and device
96-
// TODO: I'm going to prefer the DSL types whenever possible
9785
// TODO: Return type should be ErrorCodes
98-
var platform = default(PlatformIdHandle); // TODO: Using the DSL types requires us to initialize the variable first, which is annoying
86+
var platform = default(PlatformIdHandle);
9987
CheckError(cl.GetPlatformIDs(1, platform.AsRef(), nullptr));
10088

10189
var device = default(DeviceIdHandle);
@@ -259,7 +247,6 @@ public static int Main(string[] args)
259247
// Cleanup
260248
CheckError(cl.ReleaseKernel(kernel));
261249
CheckError(cl.ReleaseProgram(program));
262-
// SilkMarshal.Free(kernelSource.AsRef()); // TODO: We don't need to free the output of StringToNative, right? Seems to be a managed array backing it.
263250
CheckError(cl.ReleaseMemObject(deviceOutputBuffer));
264251
CheckError(cl.ReleaseMemObject(deviceDataBuffer2));
265252
CheckError(cl.ReleaseMemObject(deviceDataBuffer1));

0 commit comments

Comments
 (0)