|
1 | | -using NumSharp.Interfaces; |
| 1 | +using ArrayFire; |
| 2 | +using NumSharp.Interfaces; |
2 | 3 | using System; |
3 | 4 | using System.Collections.Generic; |
4 | 5 | using System.Text; |
| 6 | +using Array = ArrayFire.Array; |
5 | 7 |
|
6 | 8 | namespace NumSharp.Backends |
7 | 9 | { |
8 | 10 | public class ArrayFireEngine : ITensorEngine |
9 | 11 | { |
10 | | - public Type DType => throw new NotImplementedException(); |
11 | | - |
12 | | - public int DTypeSize => throw new NotImplementedException(); |
13 | | - |
14 | | - public Shape Shape => throw new NotImplementedException(); |
15 | | - |
16 | | - public void Allocate(Type dtype, Shape shape) |
17 | | - { |
18 | | - throw new NotImplementedException(); |
19 | | - } |
20 | | - |
21 | | - public void Allocate(Array values) |
22 | | - { |
23 | | - throw new NotImplementedException(); |
24 | | - } |
25 | | - |
26 | | - public void ChangeDataType(Type dtype) |
27 | | - { |
28 | | - throw new NotImplementedException(); |
29 | | - } |
30 | | - |
31 | | - public object Clone() |
32 | | - { |
33 | | - throw new NotImplementedException(); |
34 | | - } |
35 | | - |
36 | | - public Array CloneData() |
37 | | - { |
38 | | - throw new NotImplementedException(); |
39 | | - } |
40 | | - |
41 | | - public Array CloneData(Type dtype) |
42 | | - { |
43 | | - throw new NotImplementedException(); |
44 | | - } |
45 | | - |
46 | | - public T[] CloneData<T>() |
| 12 | + public NDArray Add(NDArray x, NDArray y) |
47 | 13 | { |
48 | 14 | throw new NotImplementedException(); |
49 | 15 | } |
50 | 16 |
|
51 | 17 | public NDArray Dot(NDArray x, NDArray y) |
52 | 18 | { |
53 | | - var dtype = x.dtype; |
54 | | - |
55 | | - switch (dtype.Name) |
56 | | - { |
57 | | - case "Int32": |
58 | | - break; |
59 | | - } |
60 | | - |
61 | | - throw new NotImplementedException("SimdEngine.dot"); |
62 | | - } |
63 | | - |
64 | | - public Array GetData() |
65 | | - { |
66 | | - throw new NotImplementedException(); |
67 | | - } |
68 | | - |
69 | | - public Array GetData(Type dtype) |
70 | | - { |
71 | | - throw new NotImplementedException(); |
72 | | - } |
73 | | - |
74 | | - public T[] GetData<T>() |
75 | | - { |
76 | | - throw new NotImplementedException(); |
77 | | - } |
78 | | - |
79 | | - public object GetData(params int[] indexes) |
80 | | - { |
81 | | - throw new NotImplementedException(); |
82 | | - } |
83 | | - |
84 | | - public T GetData<T>(params int[] indexes) |
85 | | - { |
86 | | - throw new NotImplementedException(); |
87 | | - } |
88 | | - |
89 | | - public void Reshape(params int[] dimensions) |
90 | | - { |
91 | | - throw new NotImplementedException(); |
92 | | - } |
93 | | - |
94 | | - public void SetData(Array values) |
95 | | - { |
96 | | - throw new NotImplementedException(); |
97 | | - } |
98 | | - |
99 | | - public void SetData<T>(Array values) |
100 | | - { |
101 | | - throw new NotImplementedException(); |
102 | | - } |
103 | | - |
104 | | - public void SetData(object value, params int[] indexes) |
105 | | - { |
106 | | - throw new NotImplementedException(); |
107 | | - } |
108 | | - |
109 | | - public void SetData(Array values, Type dtype) |
110 | | - { |
111 | | - throw new NotImplementedException(); |
| 19 | + return Vector.Dot(x, y); |
112 | 20 | } |
113 | 21 | } |
114 | 22 | } |
0 commit comments