Enum MemAllocMode

    • Enum Constant Detail

      • None

        public static final MemAllocMode None
        No special allocation/copy mode.
      • UseHostPointer

        public static final MemAllocMode UseHostPointer
        CL_MEM_USE_HOST_PTR: Buffer was already created in existing application code and the alignment and size rules were followed when the buffer was allocated, or you want control over the buffer allocation and do not want to rely on OpenCL. In cases when you don't want to incur the cost of a copy that would take place with CL_MEM_ALLOC_HOST_PTR | CL_MEM_COPY_HOST_PTR. In cases when data can be safely overwritten by OpenCL or you know the data will not be overwritten because your application controls any writes to the buffer. /
      • AllocateHostPointer

        public static final MemAllocMode AllocateHostPointer
        CL_MEM_ALLOC_HOST_PTR: You want the OpenCL runtime to handle the alignment and size requirements. In cases when you may be reading data from a file or another I/O stream. A brand new application being written to use OpenCL and not a port from existing code. Buffer will be initialized in host or device code and not by a library decoupled from your control. Don't forget to map and unmap the buffer during initialization.
      • Best

        public static final MemAllocMode Best
        Automatically determine best allocation mode based on device
    • Method Detail

      • values

        public static MemAllocMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MemAllocMode c : MemAllocMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MemAllocMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null