@Override
    public DataBuffer create(Pointer pointer, DataType type, long length, Indexer indexer) {
        switch (type) {
            case LONG:
                return new CudaLongDataBuffer(pointer, indexer, length);
            case INT:
                return new CudaIntDataBuffer(pointer, indexer, length);
            case DOUBLE:
                return new CudaDoubleDataBuffer(pointer, indexer, length);
            case FLOAT:
                return new CudaFloatDataBuffer(pointer, indexer, length);
            case HALF:
                return new CudaHalfDataBuffer(pointer, indexer, length);
        }

        throw new IllegalArgumentException("Illegal dtype " + type);
    }
@ Override public DataBuffer create ( Pointer pointer , DataType type , long length , Indexer indexer ) { switch ( type ) { case LONG : return new CudaLongDataBuffer ( pointer , indexer , length ) ; case INT : return new CudaIntDataBuffer ( pointer , indexer , length ) ; case DOUBLE : return new CudaDoubleDataBuffer ( pointer , indexer , length ) ; case FLOAT : return new CudaFloatDataBuffer ( pointer , indexer , length ) ; case HALF : return new CudaHalfDataBuffer ( pointer , indexer , length ) ; } throw new IllegalArgumentException ( "Illegal dtype " + type ) ; }
Create a data buffer based on the
given pointer, data buffer opType,
and length of the buffer

@param pointer the pointer to use
@param type    the opType of buffer
@param length  the length of the buffer
@param indexer
@return the data buffer
backed by this pointer with the given
opType and length.