public static extern af_err af_get_scalar([Out] long[,,,] output_value, IntPtr array_arr);
public static extern af_err af_create_strided_array(out IntPtr array_arr, [In] long[,,,] data, long dim_offset, uint ndims, [In] long[] dim_dims, [In] long[] dim_strides, af_dtype ty, af_source location);
public static extern af_err af_write_array(IntPtr array_arr, [In] long[,,,] data, UIntPtr size_bytes, af_source src);
public static extern af_err af_get_data_ptr([Out] long[,,,] data, IntPtr array_arr);
public static extern af_err af_free_host([Out] long[,,,] ptr);
public static extern af_err af_create_array(out IntPtr array_arr, [In] long[,,,] data, uint ndims, [In] long[] dim_dims, af_dtype type);
public static extern af_err af_free_device([Out] long[,,,] ptr);
public static extern af_err af_free_pinned([Out] long[,,,] ptr);
/// <summary> /// Writes the results to a file /// </summary> private static void WriteResultsToCsv(int[] sizes, float minRatio, float step, int iterations, int maxRatioIdx, long[, , ,] times, int[, ,] workloadCounts, int[, ,] elementCounts) { using (var sw = new StreamWriter("results.csv")) { sw.WriteLine("Size;Workload;Employees;Ratio;Iteration;Classic.Init;Batch.Init;Incremental.Init;Classic.Main;Batch.Main;Incremental.Main;Classic.Memory;Batch.Memory;Incremental.Memory;"); for (int sizeIdx = 0; sizeIdx < sizes.Length; sizeIdx++) { var n = sizes[sizeIdx]; for (int ratioIdx = 0; ratioIdx <= maxRatioIdx; ratioIdx++) { for (int iteration = 0; iteration < iterations; iteration++) { sw.Write(n); sw.Write(";"); sw.Write(workloadCounts[sizeIdx, ratioIdx, iteration]); sw.Write(";"); sw.Write(elementCounts[sizeIdx, ratioIdx, iteration]); sw.Write(";"); sw.Write(minRatio + (ratioIdx * step)); sw.Write(";"); sw.Write(iteration); sw.Write(";"); for (int i = 0; i < 9; i++) { sw.Write(times[sizeIdx, ratioIdx, iteration, i]); sw.Write(";"); } sw.WriteLine(); } } } } }
public static extern af_err af_device_array(out IntPtr array_arr, [In] long[,,,] data, uint ndims, [In] long[] dim_dims, DataType type);
/// <summary> /// Writes the results to a file /// </summary> private static void WriteResultsToCsv(int[] sizes, float minRatio, float step, int iterations, int maxRatioIdx, long[, , ,] times, int[, ,] workloadCounts, int[, ,] elementCounts) { using (var sw = new StreamWriter("results.csv")) { sw.WriteLine("Size;Workload;Employees;Ratio;Iteration;Poll(Init);Poll(Main);Incremental(Init);Incremental(Main);Poll(Memory);Incremental(Memory)"); for (int sizeIdx = 0; sizeIdx < sizes.Length; sizeIdx++) { var n = sizes[sizeIdx]; for (int ratioIdx = 0; ratioIdx <= maxRatioIdx; ratioIdx++) { for (int iteration = 0; iteration < iterations; iteration++) { sw.WriteLine("{0};{1};{2};{3};{4};{5};{6};{7};{8};{9};{10}", n, workloadCounts[sizeIdx, ratioIdx, iteration], elementCounts[sizeIdx, ratioIdx, iteration], minRatio + (ratioIdx * step), iteration, times[sizeIdx, ratioIdx, iteration, 0], times[sizeIdx, ratioIdx, iteration, 1], times[sizeIdx, ratioIdx, iteration, 2], times[sizeIdx, ratioIdx, iteration, 3], times[sizeIdx, ratioIdx, iteration, 4], times[sizeIdx, ratioIdx, iteration, 5]); } } } } }
public static Tensor <long> Values(long[,,,] array) { return(Values <long>(array)); }
public static long Static1(Array param1, ushort[,] param2, ref int[, , ][,,] param3, ulong[,] param4, float[][,,] param5) { long[,] local1 = (new long[100u, 30u]); #pragma warning disable 1718 while ((param1 != param1)) #pragma warning restore 1718 { for (App.m_lFwd1 = ((long)(6.0)); App.m_bFwd2; App.m_ulFwd3 -= ((ulong)(8u))) { byte local2 = App.m_byFwd4; do { long[,,,] local3 = (new long[4u, 68u, 35u, 15u]); while (App.m_bFwd2) { #pragma warning disable 1717 param1 = (param1 = param1); #pragma warning restore 1717 param3 = ((int[, , ][, , ])(param1)); do { ulong local4 = ((ulong)(108.0f)); String[][][,,,,] local5 = (new String[14u][][, , , , ]); #pragma warning disable 1718 for (App.m_sbyFwd5 *= App.m_sbyFwd5; (local4 != local4); App.m_fFwd6 = 28.0f ) #pragma warning restore 1718 { bool[][][,,,] local6 = new bool[][][, , , ] { (new bool[53u][, , , ]) }; char local7 = '\x6f'; } param4[((int)(108.0f)), 27] /= local4; }while ((param1 == null)); try { } catch (Exception) { bool local8 = true; TypedReference local9 = __makeref(App.m_chFwd7); } return((long)(91.0f)); } }while (App.m_bFwd2); if ((null != param1)) { if (App.m_bFwd2) { for (App.m_uFwd8++; Convert.ToBoolean(local2); App.m_shFwd9 -= ((short)(61)) ) { float[,] local10 = (new float[16u, 15u]); } } } } if ((param1 != null)) { for (App.m_fFwd6 *= 55.0f; App.m_bFwd2; App.m_sbyFwd5 -= ((sbyte)(122))) { object local11 = new AA().m_objField1; sbyte[, , ][] local12 = (new sbyte[108u, 78u, 18u][]); } } try { bool local13 = true; } catch (IndexOutOfRangeException) { AA[, , ][, ][] local14 = (new AA[71u, 60u, 84u][, ][]); } } return(App.m_lFwd1); }