示例#1
0
        /// <summary>
        /// Called after this object was de-serialised.
        /// </summary>
        public void OnDeserialised()
        {
            CudaContext restoredContext = CudaFloat32Handler.GetContextForDeviceId(_cudaContextDeviceId);

            _cudaContextDeviceId = restoredContext.DeviceId;

            CudaContext = restoredContext;
        }
示例#2
0
        private static void SamplePermute()
        {
            IComputationHandler handler = new CudaFloat32Handler();

            INDArray array = handler.NDArray(ArrayUtils.Range(1, 30), 5L, 3L, 2L);

            Console.WriteLine(ArrayUtils.ToString(array, (ADNDArray <float> .ToStringElement)null, 0, true));

            array.PermuteSelf(1, 0, 2);

            Console.WriteLine(ArrayUtils.ToString(array, (ADNDArray <float> .ToStringElement)null, 0, true));
        }
示例#3
0
 public CudaWorker(IOperator @operator, CudaFloat32Handler handler, ThreadPriority priority = ThreadPriority.Highest) : base(@operator, handler, priority)
 {
     _cudaHandler = handler;
 }