You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# System.ArrayExtension
1
+
# SuperchargedArray
2
2
3
3
The .NET default built-in System.Array is very limited in terms of processing and usability. Here is the extended version of the Array with accelerated speed to execute operations on almost any hardware supporting OpenCL like Intel CPU, NVIDIA, AMD, Intel GPU, FPGA etc.
4
4
@@ -48,15 +48,15 @@ for (int i = 0; i < r.GetLength(0); i++)
48
48
}
49
49
```
50
50
51
-
A super simplified version with System.ArrayExtension
//Perform Math operation on the array: 2A + Log(B) + Exp(A)
@@ -68,7 +68,7 @@ r.Print();
68
68
69
69
70
70
## Accelerated Version
71
-
System.ArrayExtension is not all about simplicity, it is well defined to execute the code on special hardwares like Intel GPU, NVIDIA, AMD cards. Below is the simple performance test done to process 100 million executions. And see the result:
71
+
SuperchargedArray is not all about simplicity, it is well defined to execute the code on special hardwares like Intel GPU, NVIDIA, AMD cards. Below is the simple performance test done to process 100 million executions. And see the result:
72
72
73
73
```csharp
74
74
publicvoidRun()
@@ -121,29 +121,29 @@ public void RunStandardLoop(int count, Array a, Array b)
121
121
Console.WriteLine(".NET For Loop Time (in ms): "+sw.ElapsedMilliseconds);
@@ -160,19 +160,21 @@ public void RunArrayAccelerated(int count, NDArray a, NDArray b, int deviceid)
160
160
161
161
### Execution Result:
162
162
163
+
Test result to execute math ops y = trunc(a * Sin(b) + cos(a) * exp(b)) for 100 million elements
164
+
163
165
.NET For Loop Time (in ms): 22317
164
166
165
-
Selected device: GeForce GTX 1080 Ti, With Accelerator (in ms): 8741
167
+
GeForce GTX 1080 Ti: 8741 ms
166
168
167
-
Selected device: Intel(R) UHD Graphics 630, With Accelerator (in ms): 6723
169
+
Intel(R) UHD Graphics 630: 6723 ms
168
170
169
-
Selected device: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz, With Accelerator (in ms): 7380
171
+
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz: 7380 ms
170
172
171
-
Selecting 33% of CPU processing, With Parallel Thread Time (in ms): 14332
173
+
33% of CPU parallel processing: 14332 ms
172
174
173
-
Selecting 66% of CPU processing, With Parallel Thread Time (in ms): 7716
175
+
66% of CPU parallel processing: 7716 ms
174
176
175
-
Selecting 100% of CPU processing, With Parallel Thread Time (in ms): 6420
177
+
100% of CPU parallel processing: : 6420 ms
176
178
177
179
The .NET standard loop takes about 22 seconds, whereas with 100% CPU parallel approach using ArrayExtension it finishes off in 6 sec which is one-fourth of time taken. But for long running process using full CPU is not ideal. With ArrayExtension.Accelerated, which internally uses SIMD (Single Instruction Multiple Data), you can achive greater speed without using 100% of the hardware. But you can always fine-tune to use 100% of the hardware and achieve ultimate speed.
0 commit comments