Exemplo n.º 1
0
        internal override void SpMV_Local_Start(double alpha, VectorBase a, double beta, VectorBase acc)
        {
            if (!m_IsLocked)
            {
                throw new ApplicationException("object must be locked.");
            }

            clVector _a   = a as clVector;
            clVector _acc = acc as clVector;

            if (_a == null)
            {
                throw new ArgumentException("a must be of type clVector.", "a");
            }
            if (_acc == null)
            {
                throw new ArgumentException("acc must be of type clVector.", "acc");
            }

            SetArguments(alpha, _a, beta, _acc);

            int[] local  = { localsize };
            int[] global = { globalsize };
            localEvent = cl.EnqueueNDRangeKernel(device.cq, clmultiply, 1, global, local);
        }
Exemplo n.º 2
0
            public override void FillSendBuffer()
            {
                if (!owner.IsLocked)
                {
                    throw new ApplicationException("works only in locked mode");
                }

                base.FillSendBuffer();

                if (size > 0)
                {
                    cl.SetKernelArg(clfill, 0, d_SendBuffer);
                    cl.SetKernelArg(clfill, 1, d_IndicesToSend);
                    cl.SetKernelArg(clfill, 2, owner.GetDevicePointer());
                    cl.SetKernelArg(clfill, 3, size);

                    int[] local  = { localsize };
                    int[] global = { globalsize };
                    cl.EnqueueNDRangeKernel(owner.device.cq, clfill, 1, global, local);

                    sendbufferevent = cl.EnqueueReadBuffer(owner.device.cq, d_SendBuffer, false, 0, (uint)size * sizeof(double), h_SendBuffer);
                }
            }
Exemplo n.º 3
0
 internal static extern ErrorCode clSetEventCallback(cl_event _event, cl_int command_exec_callback_type, EventNotifyInternal pfn_notify, IntPtr user_data);
Exemplo n.º 4
0
 internal static extern ErrorCode clReleaseEvent(cl_event _event);
Exemplo n.º 5
0
 internal static extern ErrorCode clSetUserEventStatus(cl_event _event, ExecutionStatus execution_status);
Exemplo n.º 6
0
 internal static extern ErrorCode clGetEventInfo(
     cl_event _event,
     cl_event_info param_name,
     IntPtr param_value_size,
     void *param_value,
     out IntPtr param_value_size_ret);
Exemplo n.º 7
0
 internal static extern ErrorCode clRetainEvent(cl_event _event);
Exemplo n.º 8
0
 public static ErrorCode GetEventProfilingInfo(cl_event _event, ProfilingInfo param_name, IntPtr param_value_size, void *param_value, out IntPtr param_value_size_ret)
 {
     return((ErrorCode)OpenCLAPI.clGetEventProfilingInfo(_event, (uint)param_name, param_value_size, param_value, out param_value_size_ret));
 }
Exemplo n.º 9
0
 internal static extern cl_int clGetEventProfilingInfo(cl_event _event, cl_profiling_info param_name, IntPtr param_value_size, void *param_value, out IntPtr param_value_size_ret);
Exemplo n.º 10
0
 /// <summary>
 /// OpenCL 1.1
 /// </summary>
 /// <param name="_event"></param>
 /// <param name="command_exec_callback_type"></param>
 /// <param name="pfn_notify"></param>
 /// <param name="user_data"></param>
 /// <returns></returns>
 public static ErrorCode SetEventCallback(cl_event _event, cl_int command_exec_callback_type, EventNotifyInternal pfn_notify, IntPtr user_data)
 {
     return(OpenCLAPI.clSetEventCallback(_event, command_exec_callback_type, pfn_notify, user_data));
 }
Exemplo n.º 11
0
 /// <summary>
 /// OpenCL 1.1
 /// </summary>
 /// <param name="_event"></param>
 /// <param name="execution_status"></param>
 /// <returns></returns>
 public static ErrorCode SetUserEventStatus(cl_event _event, ExecutionStatus execution_status)
 {
     return(OpenCLAPI.clSetUserEventStatus(_event, execution_status));
 }
Exemplo n.º 12
0
 public static ErrorCode ReleaseEvent(cl_event _event)
 {
     return(OpenCLAPI.clReleaseEvent(_event));
 }
Exemplo n.º 13
0
 public static ErrorCode GetEventInfo(cl_event _event, cl_event_info param_name, IntPtr param_value_size, void *param_value, out IntPtr param_value_size_ret)
 {
     return(OpenCLAPI.clGetEventInfo(_event, param_name, param_value_size, param_value, out param_value_size_ret));
 }
Exemplo n.º 14
0
		public static ErrorCode RetainEvent(cl_event _event) {
			return OpenCLAPI.clRetainEvent(_event);
		}