Commit 835769e6 authored by Mathieu Faverge's avatar Mathieu Faverge

Cleanup headers in quark directory

parent dc27a851
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
# @copyright (c) 2009-2015 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
# @copyright (c) 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# Univ. Bordeaux. All rights reserved.
#
###
#
......@@ -26,72 +26,80 @@
# @date 13-07-2012
#
###
cmake_minimum_required(VERSION 2.8)
# Generate the quark headers for all possible precisions
# ------------------------------------------------------
set(RUNTIME_HDRS_GENERATED "")
set(ZHDR
include/quark_zblas.h
include/quark_zcblas.h
)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include )
precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
PRECISIONS "s;d;c;z;ds;zc"
TARGETDIR "include")
# # Generate headers for all possible precisions
# # --------------------------------------------
# set(RUNTIME_HDRS_GENERATED "")
# set(ZHDR
# )
#
# precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
# PRECISIONS "s;d;c;z;ds;zc"
# TARGETDIR "include")
# Define the list of headers
# --------------------------
set(RUNTIME_HDRS
include/morse_quark.h
include/quark_blas.h
include/core_blas_dag.h
${RUNTIME_HDRS_GENERATED}
)
include/chameleon_quark.h
include/core_blas_dag.h
)
# # Add generated headers
# # ---------------------
# foreach( hdr_file ${RUNTIME_HDRS_GENERATED} )
# list(APPEND RUNTIME_HDRS ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
# endforeach()
# Force generation of headers
# ---------------------------
add_custom_target(runtime_quark_include ALL SOURCES ${RUNTIME_HDRS})
add_custom_target(
runtime_quark_include
ALL SOURCES ${RUNTIME_HDRS})
# installation
# Installation
# ------------
#install(FILES ${RUNTIME_HDRS}
# DESTINATION include)
install(
FILES ${RUNTIME_HDRS}
DESTINATION include/runtime/quark )
# Generate the morse common for all possible precisions
# -----------------------------------------------------
# Generate the Chameleon common for all possible precisions
# ---------------------------------------------------------
set(RUNTIME_COMMON_GENERATED "")
set(ZSRC
control/runtime_zprofiling.c
control/runtime_zlocality.c
)
control/runtime_zprofiling.c
control/runtime_zlocality.c
)
precisions_rules_py(RUNTIME_COMMON_GENERATED "${ZSRC}"
PRECISIONS "${CHAMELEON_PRECISION}"
TARGETDIR "control")
precisions_rules_py(
RUNTIME_COMMON_GENERATED "${ZSRC}"
PRECISIONS "${CHAMELEON_PRECISION}"
TARGETDIR "control")
set(RUNTIME_COMMON
control/runtime_async.c
control/runtime_context.c
control/runtime_control.c
control/runtime_descriptor.c
control/runtime_options.c
control/runtime_profiling.c
codelets/codelet_dataflush.c
${RUNTIME_COMMON_GENERATED}
)
# Generate the morse sources for all possible precisions
# ------------------------------------------------------
control/runtime_async.c
control/runtime_context.c
control/runtime_control.c
control/runtime_descriptor.c
control/runtime_options.c
control/runtime_profiling.c
codelets/codelet_dataflush.c
${RUNTIME_COMMON_GENERATED}
)
# Generate the Chameleon sources for all possible precisions
# ----------------------------------------------------------
set(RUNTIME_SRCS_GENERATED "")
set(ZSRC
${CODELETS_ZSRC}
)
${CODELETS_ZSRC}
)
precisions_rules_py(RUNTIME_SRCS_GENERATED "${ZSRC}"
PRECISIONS "${CHAMELEON_PRECISION}"
TARGETDIR "codelets")
PRECISIONS "${CHAMELEON_PRECISION}"
TARGETDIR "codelets")
set(RUNTIME_SRCS
${RUNTIME_COMMON}
......@@ -122,7 +130,7 @@ endif()
# installation
# ------------
install(TARGETS chameleon_quark
DESTINATION lib)
DESTINATION lib)
###
### END CMakeLists.txt
......
......@@ -24,7 +24,7 @@
* @date 2014-02-05
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
void MORSE_TASK_dataflush(const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An)
......
......@@ -24,7 +24,22 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_dzasum_quark(Quark *quark)
{
MORSE_enum storev;
MORSE_enum uplo;
int M;
int N;
MORSE_Complex64_t *A;
int lda;
double *work;
quark_unpack_args_7(quark, storev, uplo, M, N, A, lda, work);
CORE_dzasum(storev, uplo, M, N, A, lda, work);
}
void MORSE_TASK_dzasum(const MORSE_option_t *options,
MORSE_enum storev, MORSE_enum uplo, int M, int N,
......@@ -43,18 +58,3 @@ void MORSE_TASK_dzasum(const MORSE_option_t *options,
sizeof(double), RTBLKADDR(B, double, Bm, Bn), INOUT,
0);
}
void CORE_dzasum_quark(Quark *quark)
{
MORSE_enum storev;
MORSE_enum uplo;
int M;
int N;
MORSE_Complex64_t *A;
int lda;
double *work;
quark_unpack_args_7(quark, storev, uplo, M, N, A, lda, work);
CORE_dzasum(storev, uplo, M, N, A, lda, work);
}
......@@ -24,7 +24,21 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zaxpy_quark(Quark *quark)
{
int M;
MORSE_Complex64_t alpha;
MORSE_Complex64_t *A;
int incA;
MORSE_Complex64_t *B;
int incB;
quark_unpack_args_6(quark, M, alpha, A, incA, B, incB);
CORE_zaxpy(M, alpha, A, incA, B, incB);
}
void MORSE_TASK_zaxpy(const MORSE_option_t *options,
int M, MORSE_Complex64_t *alpha,
......@@ -42,17 +56,3 @@ void MORSE_TASK_zaxpy(const MORSE_option_t *options,
sizeof(int), &incB, VALUE,
0);
}
void CORE_zaxpy_quark(Quark *quark)
{
int M;
MORSE_Complex64_t alpha;
MORSE_Complex64_t *A;
int incA;
MORSE_Complex64_t *B;
int incB;
quark_unpack_args_6(quark, M, alpha, A, incA, B, incB);
CORE_zaxpy(M, alpha, A, incA, B, incB);
}
......@@ -29,9 +29,21 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zbuild_quark(Quark *quark)
{
MORSE_Complex64_t *A;
int lda;
void *user_data;
void (*user_build_callback)(int row_min, int row_max, int col_min, int col_max, void *buffer, int ld, void *user_data) ;
int row_min, row_max, col_min, col_max;
quark_unpack_args_8( quark, row_min, row_max, col_min, col_max, A, lda, user_data, user_build_callback);
user_build_callback(row_min, row_max, col_min, col_max, A, lda, user_data);
}
void MORSE_TASK_zbuild( const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An, int lda,
......@@ -46,28 +58,13 @@ void MORSE_TASK_zbuild( const MORSE_option_t *options,
col_max = An == A->nt-1 ? A->n-1 : col_min+A->nb-1 ;
QUARK_Insert_Task(opt->quark, CORE_zbuild_quark, (Quark_Task_Flags*)opt,
sizeof(int), &row_min, VALUE,
sizeof(int), &row_max, VALUE,
sizeof(int), &col_min, VALUE,
sizeof(int), &col_max, VALUE,
sizeof(MORSE_Complex64_t)*lda*A->nb, RTBLKADDR(A, MORSE_Complex64_t, Am, An), OUTPUT,
sizeof(int), &lda, VALUE,
sizeof(void*), &user_data, VALUE,
sizeof(void*), &user_build_callback, VALUE,
0);
}
void CORE_zbuild_quark(Quark *quark)
{
MORSE_Complex64_t *A;
int lda;
void *user_data;
void (*user_build_callback)(int row_min, int row_max, int col_min, int col_max, void *buffer, int ld, void *user_data) ;
int row_min, row_max, col_min, col_max;
quark_unpack_args_8( quark, row_min, row_max, col_min, col_max, A, lda, user_data, user_build_callback);
user_build_callback(row_min, row_max, col_min, col_max, A, lda, user_data);
sizeof(int), &row_min, VALUE,
sizeof(int), &row_max, VALUE,
sizeof(int), &col_min, VALUE,
sizeof(int), &col_max, VALUE,
sizeof(MORSE_Complex64_t)*lda*A->nb, RTBLKADDR(A, MORSE_Complex64_t, Am, An), OUTPUT,
sizeof(int), &lda, VALUE,
sizeof(void*), &user_data, VALUE,
sizeof(void*), &user_build_callback, VALUE,
0);
}
......@@ -26,7 +26,8 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zgeadd_quark(Quark *quark)
{
......
......@@ -29,7 +29,24 @@
*
**/
#include "runtime/quark/include/morse_quark.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zgelqt_quark(Quark *quark)
{
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int lda;
MORSE_Complex64_t *T;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
quark_unpack_args_9(quark, m, n, ib, A, lda, T, ldt, TAU, WORK);
CORE_zgelqt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
/**
*
......@@ -92,7 +109,6 @@
* \retval <0 if -i, the i-th argument had an illegal value
*
******************************************************************************/
void MORSE_TASK_zgelqt(const MORSE_option_t *options,
int m, int n, int ib, int nb,
const MORSE_desc_t *A, int Am, int An, int lda,
......@@ -112,20 +128,3 @@ void MORSE_TASK_zgelqt(const MORSE_option_t *options,
sizeof(MORSE_Complex64_t)*ib*nb, NULL, SCRATCH,
0);
}
void CORE_zgelqt_quark(Quark *quark)
{
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int lda;
MORSE_Complex64_t *T;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
quark_unpack_args_9(quark, m, n, ib, A, lda, T, ldt, TAU, WORK);
CORE_zgelqt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
......@@ -28,41 +28,8 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
/***************************************************************************//**
*
* @ingroup CORE_MORSE_Complex64_t
*
**/
void MORSE_TASK_zgemm(const MORSE_option_t *options,
MORSE_enum transA, int transB,
int m, int n, int k, int nb,
MORSE_Complex64_t alpha, const MORSE_desc_t *A, int Am, int An, int lda,
const MORSE_desc_t *B, int Bm, int Bn, int ldb,
MORSE_Complex64_t beta, const MORSE_desc_t *C, int Cm, int Cn, int ldc)
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_GEMM;
QUARK_Insert_Task(opt->quark, CORE_zgemm_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &transA, VALUE,
sizeof(MORSE_enum), &transB, VALUE,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(int), &k, VALUE,
sizeof(MORSE_Complex64_t), &alpha, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(A, MORSE_Complex64_t, Am, An), INPUT,
sizeof(int), &lda, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(B, MORSE_Complex64_t, Bm, Bn), INPUT,
sizeof(int), &ldb, VALUE,
sizeof(MORSE_Complex64_t), &beta, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(C, MORSE_Complex64_t, Cm, Cn), INOUT,
sizeof(int), &ldc, VALUE,
0);
}
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zgemm_quark(Quark *quark)
{
......@@ -82,16 +49,34 @@ void CORE_zgemm_quark(Quark *quark)
quark_unpack_args_13(quark, transA, transB, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
CORE_zgemm(transA, transB,
m, n, k,
alpha, A, lda,
B, ldb,
beta, C, ldc);
m, n, k,
alpha, A, lda,
B, ldb,
beta, C, ldc);
}
void MORSE_TASK_zgemm(const MORSE_option_t *options,
MORSE_enum transA, int transB,
int m, int n, int k, int nb,
MORSE_Complex64_t alpha, const MORSE_desc_t *A, int Am, int An, int lda,
const MORSE_desc_t *B, int Bm, int Bn, int ldb,
MORSE_Complex64_t beta, const MORSE_desc_t *C, int Cm, int Cn, int ldc)
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
DAG_CORE_GEMM;
QUARK_Insert_Task(opt->quark, CORE_zgemm_quark, (Quark_Task_Flags*)opt,
sizeof(MORSE_enum), &transA, VALUE,
sizeof(MORSE_enum), &transB, VALUE,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(int), &k, VALUE,
sizeof(MORSE_Complex64_t), &alpha, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(A, MORSE_Complex64_t, Am, An), INPUT,
sizeof(int), &lda, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(B, MORSE_Complex64_t, Bm, Bn), INPUT,
sizeof(int), &ldb, VALUE,
sizeof(MORSE_Complex64_t), &beta, VALUE,
sizeof(MORSE_Complex64_t)*nb*nb, RTBLKADDR(C, MORSE_Complex64_t, Cm, Cn), INOUT,
sizeof(int), &ldc, VALUE,
0);
}
......@@ -28,8 +28,24 @@
* @precisions normal z -> c d s
*
**/
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
#include "runtime/quark/include/morse_quark.h"
void CORE_zgeqrt_quark(Quark *quark)
{
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int lda;
MORSE_Complex64_t *T;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
quark_unpack_args_9(quark, m, n, ib, A, lda, T, ldt, TAU, WORK);
CORE_zgeqrt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
/**
*
......@@ -93,7 +109,6 @@
* \retval <0 if -i, the i-th argument had an illegal value
*
******************************************************************************/
void MORSE_TASK_zgeqrt(const MORSE_option_t *options,
int m, int n, int ib, int nb,
const MORSE_desc_t *A, int Am, int An, int lda,
......@@ -113,20 +128,3 @@ void MORSE_TASK_zgeqrt(const MORSE_option_t *options,
sizeof(MORSE_Complex64_t)*ib*nb, NULL, SCRATCH,
0);
}
void CORE_zgeqrt_quark(Quark *quark)
{
int m;
int n;
int ib;
MORSE_Complex64_t *A;
int lda;
MORSE_Complex64_t *T;
int ldt;
MORSE_Complex64_t *TAU;
MORSE_Complex64_t *WORK;
quark_unpack_args_9(quark, m, n, ib, A, lda, T, ldt, TAU, WORK);
CORE_zgeqrt(m, n, ib, A, lda, T, ldt, TAU, WORK);
}
......@@ -29,8 +29,26 @@
*
**/
#include "coreblas/cblas.h"
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
#include "runtime/quark/include/morse_quark.h"
void CORE_zgessm_quark(Quark *quark)
{
int m;
int n;
int k;
int ib;
int *IPIV;
MORSE_Complex64_t *L;
int ldl;
MORSE_Complex64_t *D;
int ldd;
MORSE_Complex64_t *A;
int lda;
quark_unpack_args_11(quark, m, n, k, ib, IPIV, L, ldl, D, ldd, A, lda);
CORE_zgessm(m, n, k, ib, IPIV, D, ldd, A, lda);
}
/***************************************************************************//**
*
......@@ -77,7 +95,6 @@
* \retval <0 if INFO = -k, the k-th argument had an illegal value
*
******************************************************************************/
void MORSE_TASK_zgessm(const MORSE_option_t *options,
int m, int n, int k, int ib, int nb,
int *IPIV,
......@@ -101,22 +118,3 @@ void MORSE_TASK_zgessm(const MORSE_option_t *options,
sizeof(int), &lda, VALUE,
0);
}
void CORE_zgessm_quark(Quark *quark)
{
int m;
int n;
int k;
int ib;
int *IPIV;
MORSE_Complex64_t *L;
int ldl;
MORSE_Complex64_t *D;
int ldd;
MORSE_Complex64_t *A;
int lda;
quark_unpack_args_11(quark, m, n, k, ib, IPIV, L, ldl, D, ldd, A, lda);
CORE_zgessm(m, n, k, ib, IPIV, D, ldd, A, lda);
}
......@@ -24,23 +24,8 @@
* @precisions normal z -> c d s
*
**/
#include "runtime/quark/include/morse_quark.h"
void MORSE_TASK_zgessq( const MORSE_option_t *options,
int m, int n,
const MORSE_desc_t *A, int Am, int An, int lda,
const MORSE_desc_t *SCALESUMSQ, int SCALESUMSQm, int SCALESUMSQn )
{
quark_option_t *opt = (quark_option_t*)(options->schedopt);
QUARK_Insert_Task(opt->quark, CORE_zgessq_quark, (Quark_Task_Flags*)opt,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(MORSE_Complex64_t)*lda*n, RTBLKADDR(A, MORSE_Complex64_t, Am, An), INPUT,
sizeof(int), &lda, VALUE,
sizeof(double)*2, RTBLKADDR(SCALESUMSQ, double, SCALESUMSQm, SCALESUMSQn), INOUT,
0);
}
#include "chameleon_quark.h"
#include "chameleon/morse_tasks_z.h"
void CORE_zgessq_quark(Quark *quark)
{
......@@ -53,3 +38,18 @@ void CORE_zgessq_quark(Quark *quark)
quark_unpack_args_5( quark, m, n, A, lda, SCALESUMSQ );
CORE_zgessq( m, n, A, lda, &SCALESUMSQ[0], &SCALESUMSQ[1]);
}
void MORSE_TASK_zgessq( const MORSE_option_t *options,
int m, int n,
const MORSE_desc_t *A, int Am, int An, int lda,
const MORSE_desc_t *SCALESUMSQ, int SCALESUMSQm