Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 internal static extern CLMem clCreateBuffer(CLContext context, CLMemFlags flags, SizeT size, IntPtr host_ptr, ref CLError errcode_ret);
Exemplo n.º 3
0
 public static unsafe void* Malloc(SizeT size)
 {
     return (void*)Marshal.AllocHGlobal(size);
 }
Exemplo n.º 4
0
  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);
}
Exemplo n.º 5
0
  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);
	}
  }
Exemplo n.º 6
0
  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);
	}
  }
Exemplo n.º 7
0
  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);
	}
  }
Exemplo n.º 8
0
 /// <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);
Exemplo n.º 11
0
 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);
Exemplo n.º 12
0
 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);
Exemplo n.º 13
0
 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);
Exemplo n.º 14
0
 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);
Exemplo n.º 15
0
 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);
Exemplo n.º 16
0
 /// <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)
 {
 }
Exemplo n.º 17
0
 /// <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);
Exemplo n.º 19
0
  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);
Exemplo n.º 21
0
  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);
Exemplo n.º 23
0
  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);
Exemplo n.º 25
0
  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);
Exemplo n.º 27
0
  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);
Exemplo n.º 29
0
 public unsafe static extern void Memcpy(void* pDest, void* pSrc, SizeT length);
Exemplo n.º 30
0
        /// <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);
        }
Exemplo n.º 32
0
        /// <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);
            }
        }
Exemplo n.º 33
0
 /// <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)
 {
 }
Exemplo n.º 34
0
 private void OnAlloc(IntPtr tcp, SizeT size, IntPtr buf)
 {
     this.Loop.Buffers.AllocBuffer(buf, (uint)size.Value);
 }
Exemplo n.º 35
0
 /// <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);
Exemplo n.º 37
0
        /// <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);
Exemplo n.º 39
0
  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);
	}
  }
Exemplo n.º 40
0
 public static extern CurandStatus curandGenerate(CurandGenerator generator, [Out] uint[] outputPtr, SizeT num);
Exemplo n.º 41
0
  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);
	}
  }
Exemplo n.º 42
0
 public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, [Out] ulong[] outputPtr, SizeT num);
Exemplo n.º 43
0
  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);
	}
  }
Exemplo n.º 44
0
 public static extern CurandStatus curandGenerateLongLong(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
Exemplo n.º 45
0
  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);
	}
  }
Exemplo n.º 46
0
 public static extern CurandStatus curandGenerateUniform(CurandGenerator generator, [Out] float[] outputPtr, SizeT num);
Exemplo n.º 47
0
  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);
	}
  }
Exemplo n.º 48
0
 public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT num);
Exemplo n.º 49
0
  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);
	}
Exemplo n.º 50
0
 public static extern CurandStatus curandGenerateUniformDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num);
Exemplo n.º 51
0
  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);
	}
  }
Exemplo n.º 52
0
 public static extern CurandStatus curandGenerateNormal(CurandGenerator generator, [Out] float[] outputPtr, SizeT n, float mean, float stddev);
Exemplo n.º 53
0
  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);
	}
  }
Exemplo n.º 54
0
 public static extern CurandStatus curandGenerateNormalDouble(CurandGenerator generator, [Out] double[] outputPtr, SizeT n, double mean, double stddev);
Exemplo n.º 55
0
  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);
	}
Exemplo n.º 56
0
 public static extern CurandStatus curandGenerateLogNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev);
Exemplo n.º 57
0
 public static unsafe void* Malloc(Int32 num, SizeT size)
 {
     return (void*)Marshal.AllocHGlobal(num * size);
 }
Exemplo n.º 58
0
 public static extern CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev);
Exemplo n.º 59
0
 public static extern CurandStatus curandGeneratePoisson(CurandGenerator generator, uint[] outputPtr, SizeT n, double lambda);
Exemplo n.º 60
0
 internal static extern CLError clSetKernelArg(CLKernel kernel, int arg_index, SizeT arg_size, int[] arg_value);