Skip to content

Commit 1482117

Browse files
....
1 parent 98a6905 commit 1482117

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

Examples/SuperchargedArray.Testing/PerfTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class PerfTest
1212
{
1313
public void Run()
1414
{
15-
int count = 1000000;
15+
int count = 10000000;
1616
Random rnd = new Random();
1717

1818
//Create variable A with random values
@@ -92,7 +92,7 @@ public void RunArrayAccelerated(int count, NDArray a, NDArray b, int deviceid)
9292
}
9393
catch(Exception ex)
9494
{
95-
Console.WriteLine("Error: " + ex.Message);
95+
//Console.WriteLine("Error: " + ex.Message);
9696
}
9797
}
9898
}

Examples/SuperchargedArray.Testing/SuperchargedArray.Testing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
10-
<DefineConstants>TRACE;DEBUG;NETCOREAPP;NETCOREAPP2_2;DEBUG;NETCOREAPP;NETCOREAPP2_2</DefineConstants>
10+
<DefineConstants>TRACE;DEBUG;NETCOREAPP;NETCOREAPP2_2;DEBUG;NETCOREAPP;NETCOREAPP2_2;DEBUG;NETCOREAPP;NETCOREAPP2_2</DefineConstants>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

SuperchargedArray/Accelerated/Accelerator.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ private static void LoadInternalKernels()
225225
_compiledKernels = new List<ComputeKernel>();
226226

227227
CreateKernels("InternalFloatKernels", SuperchargedArray.Properties.Resources.InternalFloatKernels);
228-
CreateKernels("InternalDoubleKernels", SuperchargedArray.Properties.Resources.InternalDoubleKernels);
228+
if(_defaultDevice.NativeVectorWidthDouble > 0)
229+
CreateKernels("InternalDoubleKernels", SuperchargedArray.Properties.Resources.InternalDoubleKernels);
229230
}
230231

231232
/// <summary>
@@ -277,7 +278,8 @@ private static Array ExecuteInternalArray<TSource>(string functionName, object[]
277278
TSource[] r = new TSource[length];
278279
result = BuildKernelArguments<TSource>(inputs, kernel, length, returnResult);
279280
commands.Execute(kernel, null, new long[] { length }, null, null);
280-
commands.ReadFromBuffer(result, ref r, true, null);
281+
commands.ReadFromBuffer(result, ref r, false, null);
282+
281283
commands.Finish();
282284
resultArray = r;
283285
r = null;
@@ -309,7 +311,7 @@ private static ComputeBuffer<TSource> BuildKernelArguments<TSource>(object[] inp
309311
kernel.SetMemoryArgument(i, result);
310312
}
311313
else
312-
kernel.SetMemoryArgument(i, new ComputeBuffer<float>(_context, ComputeMemoryFlags.CopyHostPointer, ((NDArray)item).Data<float>()));
314+
kernel.SetMemoryArgument(i, new ComputeBuffer<TSource>(_context, ComputeMemoryFlags.ReadWrite | ComputeMemoryFlags.CopyHostPointer, ((NDArray)item).Data<TSource>()));
313315
else if (item.GetType().IsPrimitive)
314316
kernel.SetValueArgument(i, (float)item);
315317

SuperchargedArray/SuperchargedArray.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,31 @@
66
<Version>0.2.0</Version>
77
<Authors>Deepak Batini</Authors>
88
<Company>Tech-Quantum</Company>
9-
<Description>An extended version of the Array to accelerate operation, easy to use, multi dimensional</Description>
9+
<Description>An extended version of the Array to accelerate operation, easy to use, multi dimensional. With SuperchargedArray.Accelerated namespace you will unlock SIMD potential to run the Array operation on any hardware like Intel CPU/GPU, NVIDIA, AMD etc.</Description>
1010
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1111
<PackageProjectUrl>https://github.com/tech-quantum/SuperchargedArray</PackageProjectUrl>
1212
<RepositoryUrl>https://github.com/tech-quantum/SuperchargedArray</RepositoryUrl>
1313
<RepositoryType>git</RepositoryType>
1414
<PackageTags>array-manipulations, array, fast array, ndarray, multi dimension array, tensor</PackageTags>
1515
<PackageIconUrl>https://raw.githubusercontent.com/tech-quantum/Arithmetica/master/icon128.png</PackageIconUrl>
16+
<Title>SuperchargedArray</Title>
17+
<PackageLicenseUrl>https://raw.githubusercontent.com/tech-quantum/SuperchargedArray/master/LICENSE</PackageLicenseUrl>
1618
</PropertyGroup>
1719

1820
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
1921
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
22+
<DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0;OSX</DefineConstants>
2023
</PropertyGroup>
2124

2225
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
2326
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
27+
<DefineConstants>TRACE;DEBUG;NETSTANDARD;NETSTANDARD2_0;OSX</DefineConstants>
2428
</PropertyGroup>
2529

2630
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
2731
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
32+
<DefineConstants>TRACE;RELEASE;NETSTANDARD;NETSTANDARD2_0;OSX</DefineConstants>
33+
<DebugType>portable</DebugType>
2834
</PropertyGroup>
2935

3036
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

0 commit comments

Comments
 (0)