Class CUdevResource

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<CUdevResource>
org.lwjgl.cuda.CUdevResource
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class CUdevResource extends org.lwjgl.system.Struct<CUdevResource> implements org.lwjgl.system.NativeResource

Layout


 struct CUdevResource {
     CUdevResourceType type;
     unsigned char _internal_padding[92];
     union {
         CUdevSmResource sm;
         unsigned char _oversize[48];
     } resource;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • _INTERNAL_PADDING

      public static final int _INTERNAL_PADDING
      The struct member offsets.
    • RESOURCE

      public static final int RESOURCE
      The struct member offsets.
    • RESOURCE_SM

      public static final int RESOURCE_SM
      The struct member offsets.
    • RESOURCE__OVERSIZE

      public static final int RESOURCE__OVERSIZE
      The struct member offsets.
  • Constructor Details

    • CUdevResource

      public CUdevResource(ByteBuffer container)
      Creates a CUdevResource instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<CUdevResource>
    • type

      public int type()
      Returns:
      the value of the type field.
    • resource_sm

      public CUdevSmResource resource_sm()
      Returns:
      a CUdevSmResource view of the resource.sm field.
    • resource__oversize

      public ByteBuffer resource__oversize()
      Returns:
      a ByteBuffer view of the resource._oversize field.
    • resource__oversize

      public byte resource__oversize(int index)
      Returns:
      the value at the specified index of the resource._oversize field.
    • malloc

      public static CUdevResource malloc()
      Returns a new CUdevResource instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static CUdevResource calloc()
      Returns a new CUdevResource instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static CUdevResource create()
      Returns a new CUdevResource instance allocated with BufferUtils.
    • create

      public static CUdevResource create(long address)
      Returns a new CUdevResource instance for the specified memory address.
    • createSafe

      public static @Nullable CUdevResource createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static CUdevResource.Buffer malloc(int capacity)
      Returns a new CUdevResource.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static CUdevResource.Buffer calloc(int capacity)
      Returns a new CUdevResource.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CUdevResource.Buffer create(int capacity)
      Returns a new CUdevResource.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static CUdevResource.Buffer create(long address, int capacity)
      Create a CUdevResource.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable CUdevResource.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static CUdevResource malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new CUdevResource instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static CUdevResource calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new CUdevResource instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static CUdevResource.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new CUdevResource.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static CUdevResource.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new CUdevResource.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • n_internal_padding

      public static ByteBuffer n_internal_padding(long struct)
    • n_internal_padding

      public static byte n_internal_padding(long struct, int index)
    • nresource_sm

      public static CUdevSmResource nresource_sm(long struct)
      Unsafe version of resource_sm().
    • nresource__oversize

      public static ByteBuffer nresource__oversize(long struct)
    • nresource__oversize

      public static byte nresource__oversize(long struct, int index)