common.h 3.03 KB
Newer Older
1
/**
2 3
 *
 * @file common.h
4
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
5 6
 * @copyright 2009-2014 The University of Tennessee and The University of
 *                      Tennessee Research Foundation. All rights reserved.
Mathieu Faverge's avatar
Mathieu Faverge committed
7
 * @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
8
 *                      Univ. Bordeaux. All rights reserved.
9
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
10
 ***
11
 *
12
 * @brief Chameleon common header file
13
 *
Mathieu Faverge's avatar
Mathieu Faverge committed
14
 * @version 1.0.0
15 16 17 18
 * @author Mathieu Faverge
 * @author Cedric Castagnede
 * @date 2012-09-15
 *
19 20
 */
/**
Mathieu Faverge's avatar
Mathieu Faverge committed
21 22
 *  CHAMELEON facilities of interest to both CHAMELEON core developer
 *  and also of interest to CHAMELEON community contributor.
23
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
24 25
#ifndef _chameleon_common_h_
#define _chameleon_common_h_
26 27 28 29 30 31 32 33


#if defined( _WIN32 ) || defined( _WIN64 )
#include <io.h>
#else
#include <unistd.h>
#endif

34
/**
35
 * Implementation headers
36
 */
37
#if defined(CHAMELEON_USE_CUDA) && !defined(CHAMELEON_SIMULATION)
38 39 40
#include <cuda.h>
#include <cuda_runtime.h>
#include <cuda_runtime_api.h>
41
#if defined(CHAMELEON_USE_CUBLAS_V2)
42
#include <cublas.h>
43 44
#include <cublas_v2.h>
#else
45 46
#include <cublas.h>
#endif
47
#endif
48

49
#if defined(CHAMELEON_USE_OPENCL) && !defined(CHAMELEON_SIMULATION)
50 51 52
#include <OpenCL/cl.h>
#endif

53
#if defined(CHAMELEON_USE_MPI)
54 55 56
#include <mpi.h>
#endif

57
/**
58 59
 *  Line to avoid conflict with other linear algebra libraries, because, we
 *  don't know why but lapacke provide a wrong interface of lapack in fortran
60
 */
61 62 63
#ifndef LAPACK_NAME
#define LAPACK_NAME(a, b) lapackef77_##a
#endif
64

65
/**
66
 *  Chameleon header files
67
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
68
#include "chameleon.h"
69

70 71
#include "control/global.h"
#include "control/auxiliary.h"
72 73
#include "control/context.h"
#include "control/descriptor.h"
74
#include "control/async.h"
75

76
/**
77
 *  Global shortcuts
78
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
79 80 81 82 83 84 85
#define CHAMELEON_RANK        chameleon_rank(chamctxt)
#define CHAMELEON_NB          chamctxt->nb
#define CHAMELEON_IB          chamctxt->ib
#define CHAMELEON_RHBLK       chamctxt->rhblock
#define CHAMELEON_TRANSLATION chamctxt->translation
#define CHAMELEON_PARALLEL    chamctxt->parallel_enabled
#define CHAMELEON_PROFILING   chamctxt->profiling_enabled
86
#if defined(CHAMELEON_USE_MPI)
Mathieu Faverge's avatar
Mathieu Faverge committed
87 88
#define CHAMELEON_MPI_RANK    chamctxt->my_mpi_rank
#define CHAMELEON_MPI_SIZE    chamctxt->mpi_comm_size
89 90
#endif

91
/**
92
 *  IPT internal define
93
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
94 95 96
#define ChamIPT_NoDep   0
#define ChamIPT_Panel   1
#define ChamIPT_All     2
97

98
/**
99
 *  Global array of LAPACK constants
100
 */
Mathieu Faverge's avatar
Mathieu Faverge committed
101 102
extern char *chameleon_lapack_constants[];
#define chameleon_lapack_const(chameleon_const) chameleon_lapack_constants[chameleon_const][0]
103 104 105 106 107

#ifdef __cplusplus
extern "C" {
#endif

Mathieu Faverge's avatar
Mathieu Faverge committed
108 109 110 111
void chameleon_pmap( cham_uplo_t uplo, CHAM_desc_t *A,
                     cham_unary_operator_t operator, void *op_args,
                     RUNTIME_sequence_t *sequence, RUNTIME_request_t *request );

112 113 114 115
#include "control/compute_s.h"
#include "control/compute_d.h"
#include "control/compute_c.h"
#include "control/compute_z.h"
116 117

/*
Mathieu Faverge's avatar
Mathieu Faverge committed
118 119 120 121
void chameleon_pdlag2s(CHAM_context_t *chamctxt);
void chameleon_pzlag2c(CHAM_context_t *chamctxt);
void chameleon_pslag2d(CHAM_context_t *chamctxt);
void chameleon_pclag2z(CHAM_context_t *chamctxt);
122 123 124 125 126 127
*/

#ifdef __cplusplus
}
#endif

Mathieu Faverge's avatar
Mathieu Faverge committed
128
#endif /* _chameleon_common_h_ */