Main Content

gpucoder.ctranspose

Optimized GPU implementation of the MATLAB transpose function

    Description

    example

    B = gpucoder.ctranspose(A) performs efficient out-of-place conjugate transpose on the GPU using shared memory. When called from MATLAB® (out of the code generation context), gpucoder.ctranspose calls the built-in ctranspose function.

    Examples

    collapse all

    This example generates CUDA® code to transpose a matrix.

    In one file, write an entry-point function myTranspose that accepts a matrix input A. Use the gpucoder.ctranspose function to generate a GPU efficient implementation for transposing A.

    function B = myTranspose(A)
         B = gpucoder.ctranspose(A);
    end

    Use the codegen function to generate CUDA MEX function.

    input = complex(ones(1024,1024,'double'),ones(1024,1024,'double'));
    codegen -config coder.gpuConfig('mex') -args {input} -report myTranspose

    Input Arguments

    collapse all

    Input array, specified as a vector or matrix.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char
    Complex Number Support: Yes

    Output Arguments

    collapse all

    Transposed array, returned as a vector or matrix.

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char

    Limitations

    • gpucoder.ctranspose does not support inputs that are of dimension greater than two.

    Version History

    Introduced in R2019a