Skip to content

Commit

Permalink
added base of clBuiltInHelper for future helper functions to be added…
Browse files Browse the repository at this point in the history
… before the kernel string (optionally)
  • Loading branch information
tugrul512bit committed Apr 15, 2017
1 parent 78f0b5f commit 8b7d65b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cekirdekler/Cekirdekler/Cekirdekler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClBuiltInAuxilliaryFunctions.cs" />
<Compile Include="ClCruncherClient.cs" />
<Compile Include="Cores.cs" />
<Compile Include="ClCruncherServer.cs" />
Expand Down
31 changes: 31 additions & 0 deletions Cekirdekler/Cekirdekler/ClBuiltInAuxilliaryFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cekirdekler
{
namespace ClBuiltInHelper
{
/// <summary>
/// <para>Only setting some flags will add some functions to beginning of OpenCL kernel string before compile</para>
/// <para>Not implemented(yet)</para>
/// </summary>
public class ClBuiltInAuxilliaryFunctions
{

private StringBuilder selectedFunctionsBuilder = new StringBuilder(@"");
private bool prepared = false;

private string exampleFunctionString = Environment.NewLine+ @"void exampleFunction(int a,int b){return a+b;}"+Environment.NewLine;
private bool exampleFunctionPrivate = false;
/// <summary>
/// adds "void exampleFunction(int a,int b){return a+b;}" in the beginning of kernel string
/// </summary>
public bool exampleFunction {
get { if (!prepared) { selectedFunctionsBuilder.Append(exampleFunctionString); } return exampleFunctionPrivate; }
set { exampleFunctionPrivate = value; }
}
}
}
}

0 comments on commit 8b7d65b

Please sign in to comment.