public static unsafe void* Memset(void* ptr, Byte val, SizeT num) { Byte* pStart = (Byte*)ptr; Byte* pEnd = pStart + num; while (pStart < pEnd) { *pStart = val; pStart++; } return ptr; }
internal static extern CLMem clCreateBuffer(CLContext context, CLMemFlags flags, SizeT size, IntPtr host_ptr, ref CLError errcode_ret);
public static unsafe void* Malloc(SizeT size) { return (void*)Marshal.AllocHGlobal(size); }
public static byte[] WmoReadBufrFromFileMalloc(GribFile f, int headers_only, ref SizeT size, ref SizeT offset, out int err) { return GribApiProxyPINVOKE.WmoReadBufrFromFileMalloc(f.Reference, headers_only, ref size.Value, ref offset.Value, out err); }
public static void GribSetValues(GribHandle h, SWIGTYPE_p_grib_values grib_values, SizeT arg_count) { int ret = GribApiProxyPINVOKE.GribSetValues(h.Reference, SWIGTYPE_p_grib_values.getCPtr(grib_values), arg_count.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static void GribSetBytes(GribHandle h, string key, byte[] bytes, ref SizeT length) { int ret = GribApiProxyPINVOKE.GribSetBytes(h.Reference, key, bytes, ref length.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static void GribGetData(GribHandle h, double[] lats, double[] lons, double[] values, ref SizeT size) { int ret = GribApiProxyPINVOKE.GribGetData(h.Reference, lats, lons, values, ref size.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
/// <summary> /// Creates a new 2D FFT plan (new API) /// </summary> /// <param name="handle">cufftHandle object</param> /// <param name="nx">The transform size in the X dimension (number of rows)</param> /// <param name="ny">The transform size in the Y dimension (number of columns)</param> /// <param name="type">The transform data type (e.g., C2R for complex to real)</param> /// <param name="size"></param> /// <param name="autoAllocate">indicates that the caller intends to allocate and manage /// work areas for plans that have been generated.</param> public CudaFFTPlan2D(cufftHandle handle, int nx, int ny, cufftType type, ref SizeT size, bool autoAllocate) : this(handle, nx, ny, type, ref size) { SetAutoAllocation(autoAllocate); }
public static extern nvjpegStatus nvjpegGetImageInfo(nvjpegHandle handle, byte[] data, SizeT length, ref int nComponents, ref nvjpegChromaSubsampling subsampling, int[] widths, int[] heights);
public static extern nvjpegStatus nvjpegGetPinnedMemoryPadding(ref SizeT padding, nvjpegHandle handle);
internal static extern IntPtr clEnqueueMapImage(CLCommandQueue command_queue, CLMem image, CLBool blocking_map, CLMapFlags map_flags, SizeT[] origin, SizeT[] region, ref SizeT image_row_pitch, ref SizeT image_slice_pitch, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e, ref CLError errcode_ret);
internal static extern IntPtr clEnqueueMapBuffer(CLCommandQueue command_queue, CLMem buffer, CLBool blocking_map, CLMapFlags map_flags, SizeT offset, SizeT cb, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e, ref CLError errcode_ret);
internal static extern CLError clEnqueueCopyImageToBuffer(CLCommandQueue command_queue, CLMem src_image, CLMem dst_buffer, SizeT[] src_origin, SizeT[] region, SizeT dst_offset, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueCopyBuffer(CLCommandQueue command_queue, CLMem src_buffer, CLMem dst_buffer, SizeT src_offset, SizeT dst_offset, SizeT cb, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLMem clCreateImage3D(CLContext context, CLMemFlags flags, ref CLImageFormat image_format, SizeT image_width, SizeT image_height, SizeT image_depth, SizeT image_row_pitch, SizeT image_slice_pitch, IntPtr host_ptr, ref CLError errcode_ret);
/// <summary>Initializes a new instance of the <see cref="SafeLocalHandle"/> class.</summary> /// <param name="handle">The handle.</param> /// <param name="size">The size of memory allocated to the handle, in bytes.</param> /// <param name="ownsHandle">if set to <c>true</c> if this class is responsible for freeing the memory on disposal.</param> public SafeLocalHandle(HLOCAL handle, SizeT size, bool ownsHandle = true) : base((IntPtr)handle, size, ownsHandle) { }
/// <summary> /// Creates a new 2D FFT plan (new API) /// </summary> /// <param name="handle">cufftHandle object</param> /// <param name="nx">The transform size in the X dimension (number of rows)</param> /// <param name="ny">The transform size in the Y dimension (number of columns)</param> /// <param name="type">The transform data type (e.g., C2R for complex to real)</param> /// <param name="stream">A valid CUDA stream created with cudaStreamCreate() (or 0 for the default stream)</param> /// <param name="size"></param> public CudaFFTPlan2D(cufftHandle handle, int nx, int ny, cufftType type, CUstream stream, ref SizeT size) : this(handle, nx, ny, type, ref size) { SetStream(stream); }
public static extern nvjpegStatus nvjpegDecode(nvjpegHandle handle, nvjpegJpegState jpeg_handle, IntPtr data, SizeT length, nvjpegOutputFormat output_format, ref nvjpegImage destination, CUstream stream);
public static GribHandle GribHandleNewFromMultiMessage(GribContext c, out System.IntPtr data, ref SizeT data_len, out int error) { System.IntPtr pVal = GribApiProxyPINVOKE.GribHandleNewFromMultiMessage(c.Reference, out data, ref data_len.Value, out error); return pVal == System.IntPtr.Zero ? null : new GribHandle(pVal); }
public static extern nvjpegStatus nvjpegEncodeGetBufferSize( nvjpegHandle handle, nvjpegEncoderParams encoder_params, int image_width, int image_height, ref SizeT max_stream_length);
public static void GribGetOffset(GribHandle h, string key, ref SizeT offset) { int ret = GribApiProxyPINVOKE.GribGetOffset(h.Reference, key, ref offset.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern nvjpegStatus nvjpegEncodeRetrieveBitstream( nvjpegHandle handle, nvjpegEncoderState encoder_state, IntPtr data, ref SizeT length, CUstream stream);
public static void GribKeysIteratorGetString(GribKeysIterator kiter, System.Text.StringBuilder v, ref SizeT len) { int ret = GribApiProxyPINVOKE.GribKeysIteratorGetString(kiter.Reference, v, ref len.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern nvjpegStatus nvjpegBufferPinnedRetrieve(nvjpegBufferPinned buffer, ref SizeT size, ref IntPtr ptr);
public static void WmoReadGtsFromFile(GribFile f, byte[] buffer, ref SizeT len) { int ret = GribApiProxyPINVOKE.WmoReadGtsFromFile(f.Reference, buffer, ref len.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern nvjpegStatus nvjpegBufferDeviceRetrieve(nvjpegBufferDevice buffer, ref SizeT size, ref CUdeviceptr ptr);
public static void GribGetMessageSize(GribHandle h, ref SizeT size) { int ret = GribApiProxyPINVOKE.GribGetMessageSize(h.Reference, ref size.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern nvjpegStatus nvjpegJpegStreamParseHeader( nvjpegHandle handle, byte[] data, SizeT length, nvjpegJpegStream jpeg_stream);
public unsafe static extern void Memcpy(void* pDest, void* pSrc, SizeT length);
/// <summary> /// Create a new CudaArray3D and bind it to a surface reference. /// </summary> /// <param name="kernel"></param> /// <param name="surfName"></param> /// <param name="flags"></param> /// <param name="format"></param> /// <param name="width">In elements</param> /// <param name="height">In elements</param> /// <param name="depth">In elements</param> /// <param name="numChannels"></param> /// <param name="arrayFlags"></param> public static CudaArray3D BindArray(CudaKernel kernel, string surfName, CUSurfRefSetFlags flags, CUArrayFormat format, SizeT width, SizeT height, SizeT depth, CudaArray3DNumChannels numChannels, CUDAArray3DFlags arrayFlags) { CUsurfref surfref = new CUsurfref(); CUResult res = DriverAPINativeMethods.ModuleManagement.cuModuleGetSurfRef(ref surfref, kernel.CUModule, surfName); Debug.WriteLine(String.Format("{0:G}, {1}: {2}, Surface name: {3}", DateTime.Now, "cuModuleGetSurfRef", res, surfName)); if (res != CUResult.Success) { throw new CudaException(res); } CudaArray3D array = new CudaArray3D(format, width, height, depth, numChannels, arrayFlags); res = DriverAPINativeMethods.SurfaceReferenceManagement.cuSurfRefSetArray(surfref, array.CUArray, flags); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuSurfRefSetArray", res)); if (res != CUResult.Success) { throw new CudaException(res); } return(array); }
/// <summary> /// Creates a new 1D texture from linear memory. Allocates a new device variable /// </summary> /// <param name="kernel"></param> /// <param name="texName"></param> /// <param name="addressMode0"></param> /// <param name="flags"></param> /// <param name="format"></param> /// <param name="size">In elements</param> public CudaTextureLinear1D(CudaKernel kernel, string texName, CUTexRefSetFlags flags, CUAddressMode addressMode0, CUArrayFormat format, SizeT size) { _texref = new CUtexref(); res = DriverAPINativeMethods.ModuleManagement.cuModuleGetTexRef(ref _texref, kernel.CUModule, texName); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}, Texture name: {3}", DateTime.Now, "cuModuleGetTexRef", res, texName)); if (res != CUResult.Success) { throw new CudaException(res); } res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetAddressMode(_texref, 0, addressMode0); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetAddressMode", res)); if (res != CUResult.Success) { throw new CudaException(res); } res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFilterMode(_texref, CUFilterMode.Point); //Textures from linear memory can only by point filtered Debug.Write(""); //Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFilterMode", res)); if (res != CUResult.Success) { throw new CudaException(res); } res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFlags(_texref, flags); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFlags", res)); if (res != CUResult.Success) { throw new CudaException(res); } _numChannels = CudaHelperMethods.GetNumChannels(typeof(T)); res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetFormat(_texref, format, _numChannels); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetFormat", res)); if (res != CUResult.Success) { throw new CudaException(res); } _filtermode = CUFilterMode.Point; _flags = flags; _addressMode0 = addressMode0; _format = format; _size = size; _name = texName; _module = kernel.CUModule; _cufunction = kernel.CUFunction; _channelSize = CudaHelperMethods.GetChannelSize(format); _dataSize = _size * (SizeT)_numChannels * _channelSize;//; _devVar = new CudaDeviceVariable <T>(_size); SizeT NULL = 0; res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetAddress_v2(ref NULL, _texref, _devVar.DevicePointer, _dataSize); Debug.Write("");//Line(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetAddress", res)); if (res != CUResult.Success) { throw new CudaException(res); } //res = DriverAPINativeMethods.ParameterManagement.cuParamSetTexRef(kernel.CUFunction, CUParameterTexRef.Default, _texref); //Debug.Write("");//Line("{0:G}, {1}: {2}", DateTime.Now, "cuParamSetTexRef", res); //if (res != CUResult.Success) throw new CudaException(res); }
/// <summary> /// Creates a new surface from array memory. Allocates new array. /// </summary> /// <param name="kernel"></param> /// <param name="surfName"></param> /// <param name="flags"></param> /// <param name="format"></param> /// <param name="width">In elements</param> /// <param name="height">In elements</param> /// <param name="depth">In elements</param> /// <param name="numChannels"></param> /// <param name="arrayFlags"></param> public CudaSurface(CudaKernel kernel, string surfName, CUSurfRefSetFlags flags, CUArrayFormat format, SizeT width, SizeT height, SizeT depth, CudaArray3DNumChannels numChannels, CUDAArray3DFlags arrayFlags) { _surfref = new CUsurfref(); res = DriverAPINativeMethods.ModuleManagement.cuModuleGetSurfRef(ref _surfref, kernel.CUModule, surfName); Debug.WriteLine(String.Format("{0:G}, {1}: {2}, Surface name: {3}", DateTime.Now, "cuModuleGetSurfRef", res, surfName)); if (res != CUResult.Success) { throw new CudaException(res); } _flags = flags; _format = format; _height = height; _width = width; _depth = depth; _numChannels = (int)numChannels; _name = surfName; _module = kernel.CUModule; _cufunction = kernel.CUFunction; _channelSize = CudaHelperMethods.GetChannelSize(format); _dataSize = height * width * depth * _numChannels * _channelSize; _array = new CudaArray3D(format, width, height, depth, numChannels, arrayFlags); res = DriverAPINativeMethods.SurfaceReferenceManagement.cuSurfRefSetArray(_surfref, _array.CUArray, flags); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuSurfRefSetArray", res)); if (res != CUResult.Success) { throw new CudaException(res); } }
/// <summary>Initializes a new instance of the <see cref="SafeLocalHandle"/> class.</summary> /// <param name="size">The size of memory to allocate, in bytes.</param> /// <exception cref="System.ArgumentOutOfRangeException">size - The value of this argument must be non-negative</exception> public SafeLocalHandle(SizeT size) : base(size) { }
private void OnAlloc(IntPtr tcp, SizeT size, IntPtr buf) { this.Loop.Buffers.AllocBuffer(buf, (uint)size.Value); }
/// <summary> /// Creates a new 2D FFT plan (new API) /// </summary> /// <param name="handle">cufftHandle object</param> /// <param name="nx">The transform size in the X dimension (number of rows)</param> /// <param name="ny">The transform size in the Y dimension (number of columns)</param> /// <param name="type">The transform data type (e.g., C2R for complex to real)</param> /// <param name="stream">A valid CUDA stream created with cudaStreamCreate() (or 0 for the default stream)</param> /// <param name="mode">The <see cref="Compatibility"/> option to be used</param> /// <param name="size"></param> public CudaFFTPlan2D(cufftHandle handle, int nx, int ny, cufftType type, CUstream stream, Compatibility mode, ref SizeT size) : this(handle, nx, ny, type, ref size) { SetStream(stream); SetCompatibilityMode(mode); }
public static extern nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, ref SizeT logSizeRet);
/// <summary> /// Get platform and device info /// </summary> internal static void GetInfo() { try { uint num_entries = 0; uint num_entries_devices = 0; // get device CLPlatformID[] platforms = new CLPlatformID[5]; CLError err = OpenCLDriver.clGetPlatformIDs(5, platforms, ref num_entries); if (err != CLError.Success) throw new Exception(err.ToString()); if (num_entries == 0) throw new Exception("No Platform Entries found!"); // get platform properties byte[] buffer = new byte[1000]; GCHandle bufferGC = GCHandle.Alloc(buffer, GCHandleType.Pinned); SizeT buffSize, buffSizeOut = new SizeT(); for (int i = 0; i < num_entries; i++) { buffSize = new CASS.Types.SizeT(1000); err = OpenCLDriver.clGetPlatformInfo(platforms[i], CLPlatformInfo.Name, buffSize, bufferGC.AddrOfPinnedObject(), ref buffSizeOut); if (err != CLError.Success) throw new Exception(err.ToString()); MessageBox.Show("Platform: " + i + "\n" + System.Text.Encoding.ASCII.GetString(buffer)); CLDeviceID[] devices = new CLDeviceID[2]; err = OpenCLDriver.clGetDeviceIDs(platforms[i], CLDeviceType.All, 2, devices, ref num_entries_devices); if (err != CLError.Success) throw new Exception(err.ToString()); string result = ""; err = OpenCLDriver.clGetDeviceInfo(devices[0], CLDeviceInfo.Vendor, buffSize, bufferGC.AddrOfPinnedObject(), ref buffSizeOut); result += CLDeviceInfo.Vendor.ToString() + ": " + Encoding.ASCII.GetString(buffer, 0, buffSizeOut - 1) + "\n"; buffSize = new CASS.Types.SizeT(1000); err = OpenCLDriver.clGetDeviceInfo(devices[0], CLDeviceInfo.Name, buffSize, bufferGC.AddrOfPinnedObject(), ref buffSizeOut); result += CLDeviceInfo.Name.ToString() + ": " + Encoding.ASCII.GetString(buffer, 0, buffSizeOut - 1) + "\n"; int[] workDim = new int[1]; bufferGC = GCHandle.Alloc(workDim, GCHandleType.Pinned); buffSize = new CASS.Types.SizeT(sizeof(int)); err = OpenCLDriver.clGetDeviceInfo(devices[0], CLDeviceInfo.MaxComputeUnits, buffSize, bufferGC.AddrOfPinnedObject(), ref buffSizeOut); result += CLDeviceInfo.MaxComputeUnits.ToString() + ": " + workDim[0] + "\n"; err = OpenCLDriver.clGetDeviceInfo(devices[0], CLDeviceInfo.MaxWorkItemDimensions, workDim.Length * sizeof(int), bufferGC.AddrOfPinnedObject(), ref buffSizeOut); result += CLDeviceInfo.MaxWorkItemDimensions.ToString() + ": " + workDim[0] + "\n"; SizeT[] sizeWI = new SizeT[workDim[0]]; bufferGC = GCHandle.Alloc(sizeWI, GCHandleType.Pinned); err = OpenCLDriver.clGetDeviceInfo(devices[0], CLDeviceInfo.MaxWorkItemSizes, sizeWI.Length * sizeof(int), bufferGC.AddrOfPinnedObject(), ref buffSizeOut); result += CLDeviceInfo.MaxWorkItemSizes.ToString() + ": " + sizeWI[0] + "x" + sizeWI[1] + "x" + sizeWI[2] + "\n"; MessageBox.Show(result, "Device"); } } catch (Exception exc) { MessageBox.Show(exc.ToString()); } }
public static extern nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, ref SizeT ptxSizeRet);
public static void GribGetMessageCopy(GribHandle h, byte[] message, ref SizeT message_length) { int ret = GribApiProxyPINVOKE.GribGetMessageCopy(h.Reference, message, ref message_length.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerate(CurandGenerator generator, [Out] uint[] outputPtr, SizeT num);
public static void GribNearestFind(SWIGTYPE_p_grib_nearest nearest, GribHandle h, double inlat, double inlon, uint flags, double[] outlats, double[] outlons, double[] values, double[] distances, int[] indexes, ref SizeT len) { int ret = GribApiProxyPINVOKE.GribNearestFind(SWIGTYPE_p_grib_nearest.getCPtr(nearest), h.Reference, inlat, inlon, flags, outlats, outlons, values, distances, indexes, ref len.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, [Out] ulong[] outputPtr, SizeT num);
public static void GribGetString(GribHandle h, string key, System.Text.StringBuilder mesg, ref SizeT length) { int ret = GribApiProxyPINVOKE.GribGetString(h.Reference, key, mesg, ref length.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
public static void GribSetLongArray(GribHandle h, string key, int[] vals, SizeT length) { int ret = GribApiProxyPINVOKE.GribSetLongArray(h.Reference, key, vals, length.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateUniform(CurandGenerator generator, [Out] float[] outputPtr, SizeT num);
public static void GribKeysIteratorGetBytes(GribKeysIterator kiter, byte[] v, ref SizeT len) { int ret = GribApiProxyPINVOKE.GribKeysIteratorGetBytes(kiter.Reference, v, ref len.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT num);
public static GribHandle GribHandleNewFromPartialMessage(GribContext c, byte[] data, SizeT buflen) { System.IntPtr pVal = GribApiProxyPINVOKE.GribHandleNewFromPartialMessage(c.Reference, data, buflen.Value); return pVal == System.IntPtr.Zero ? null : new GribHandle(pVal); }
public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
public static void WmoReadAnyFromStream(byte[] stream_data, SWIGTYPE_p_f_p_void_p_void_long__long stream_proc, byte[] buffer, ref SizeT len) { int ret = GribApiProxyPINVOKE.WmoReadAnyFromStream(stream_data, SWIGTYPE_p_f_p_void_p_void_long__long.getCPtr(stream_proc), buffer, ref len.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateNormal(CurandGenerator generator, [Out] float[] outputPtr, SizeT n, float mean, float stddev);
public static void GribIndexGetSize(SWIGTYPE_p_grib_index index, string key, ref SizeT size) { int ret = GribApiProxyPINVOKE.GribIndexGetSize(SWIGTYPE_p_grib_index.getCPtr(index), key, ref size.Value); if (ret != 0) { throw Grib.Api.Interop.GribApiException.Create(ret); } }
public static extern CurandStatus curandGenerateNormalDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT n, double mean, double stddev);
public static GribHandle GribUtilSetSpec(GribHandle h, GribUtilGridSpec grid_spec, GribUtilPackingSpec packing_spec, int flags, double[] data_values, SizeT data_values_count, out int err) { System.IntPtr pVal = GribApiProxyPINVOKE.GribUtilSetSpec(h.Reference, GribUtilGridSpec.getCPtr(grid_spec), GribUtilPackingSpec.getCPtr(packing_spec), flags, data_values, data_values_count.Value, out err); return pVal == System.IntPtr.Zero ? null : new GribHandle(pVal); }
public static extern CurandStatus curandGenerateLogNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev);
public static unsafe void* Malloc(Int32 num, SizeT size) { return (void*)Marshal.AllocHGlobal(num * size); }
public static extern CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev);
public static extern CurandStatus curandGeneratePoisson(CurandGenerator generator, uint[] outputPtr, SizeT n, double lambda);
internal static extern CLError clSetKernelArg(CLKernel kernel, int arg_index, SizeT arg_size, int[] arg_value);