Exemple #1
0
void FC_FUNC_(clamdblasztrsmex_low, CLAMDBLASZTRSMEX_LOW)(int * order,
							  int * side,
							  int * uplo,
							  int * transA,
							  int * diag,
							  cl_long * M,
							  cl_long * N,
							  DoubleComplex * alpha,
							  const cl_mem * A,
							  size_t * offA,
							  size_t * lda,
							  cl_mem * B,
							  size_t * offB,
							  size_t * ldb, 
							  cl_command_queue * CommandQueue, 
							  int * status){


  *status = clAmdBlasZtrsmEx((clAmdBlasOrder) *order, (clAmdBlasSide) *side, (clAmdBlasUplo) *uplo, 
			     (clAmdBlasTranspose) *transA, (clAmdBlasDiag) *diag,
			     (size_t) *M, (size_t) *N, *alpha, 
			     *A, (size_t) *offA, (size_t) *lda, 
			     *B, (size_t) *offB, (size_t) *ldb, 
			     1, CommandQueue, 0, NULL, NULL);
}
// --------------------
    magma_err_t
magma_ztrsm(
        magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag,
        magma_int_t m, magma_int_t n,
        magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, size_t dA_offset, magma_int_t lda,
        magmaDoubleComplex_ptr       dB, size_t dB_offset, magma_int_t ldb,
        magma_queue_t queue )
{
/*    
    magmaDoubleComplex *hA, *hB;
    if(side==MagmaRight){
        hA = (magmaDoubleComplex*)malloc(lda*n*sizeof(magmaDoubleComplex));
        hB = (magmaDoubleComplex*)malloc(ldb*n*sizeof(magmaDoubleComplex));
        magma_zgetmatrix(n, n, dA, dA_offset, lda, hA, 0, lda, queue);
        magma_zgetmatrix(m, n, dB, dB_offset, ldb, hB, 0, ldb, queue);
#if defined(PRECISION_z) || defined(PRECISION_c)
        cblas_ztrsm(CblasColMajor, (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
                m, n,
                &alpha, hA, lda, hB, ldb);
#else
        cblas_ztrsm(CblasColMajor, (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag,
                m, n,
                alpha, hA, lda, hB, ldb);
#endif
        magma_zsetmatrix(m, n, hB, 0, ldb, dB, dB_offset, ldb, queue);
        free(hB);
        free(hA);
    }else{
        hA = (magmaDoubleComplex*)malloc(lda*m*sizeof(magmaDoubleComplex));
        hB = (magmaDoubleComplex*)malloc(ldb*n*sizeof(magmaDoubleComplex));
        magma_zgetmatrix(m, m, dA, dA_offset, lda, hA, 0, lda, queue);
        magma_zgetmatrix(m, n, dB, dB_offset, ldb, hB, 0, ldb, queue);
#if defined(PRECISION_z) || defined(PRECISION_c)
        cblas_ztrsm(CblasColMajor, (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag, 
                m, n,
                &alpha, hA, lda, hB, ldb);
#else
        cblas_ztrsm(CblasColMajor, (CBLAS_SIDE)side, (CBLAS_UPLO)uplo, (CBLAS_TRANSPOSE)trans, (CBLAS_DIAG)diag, 
                m, n,
                alpha, hA, lda, hB, ldb);
#endif
        magma_zsetmatrix(m, n, hB, 0, ldb, dB, dB_offset, ldb, queue);
        free(hB);
        free(hA);
    }
    return CL_SUCCESS;
*/
       cl_int err = clAmdBlasZtrsmEx(
       clAmdBlasColumnMajor,
       amdblas_side_const( side ),
       amdblas_uplo_const( uplo ),
       amdblas_trans_const( trans ),
       amdblas_diag_const( diag ),
       m, n,
       alpha, dA, dA_offset, lda,
       dB, dB_offset, ldb,
       1, &queue, 0, NULL, NULL );
       clFlush(queue);
       return err;
}
    magma_err_t
magma_ztrsm_trace(
        magma_side_t side, magma_uplo_t uplo, magma_trans_t trans, magma_diag_t diag,
        magma_int_t m, magma_int_t n,
        magmaDoubleComplex alpha, magmaDoubleComplex_const_ptr dA, size_t dA_offset, magma_int_t lda,
        magmaDoubleComplex_ptr       dB, size_t dB_offset, magma_int_t ldb,
        magma_queue_t queue, magma_event_t* event )
{
    cl_int err = clAmdBlasZtrsmEx(
            clAmdBlasColumnMajor,
            amdblas_side_const( side ),
            amdblas_uplo_const( uplo ),
            amdblas_trans_const( trans ),
            amdblas_diag_const( diag ),
            m, n,
            alpha, dA, dA_offset, lda,
            dB, dB_offset, ldb,
            1, &queue, 0, NULL, event );
    clFlush(queue);
    return err;
}