PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
workspace.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int plasma_alloc_ibnb (int M, int N, PLASMA_enum func, int type, void **memptr)
int plasma_alloc_ibnb_tile (int M, int N, PLASMA_enum func, int type, PLASMA_desc **desc)
int plasma_alloc_ipiv (int M, int N, PLASMA_enum func, void **memptr)

Detailed Description

PLASMA auxiliary routines PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

Version:
2.4.5
Author:
Jakub Kurzak
Date:
2010-11-15

Definition in file workspace.h.


Function Documentation

int plasma_alloc_ibnb ( int  M,
int  N,
PLASMA_enum  func,
int  type,
void **  memptr 
)

Internal routines

Definition at line 24 of file workspace.c.

References plasma_context_struct::householder, plasma_context_self(), plasma_element_size(), PLASMA_ERR_NOT_INITIALIZED, PLASMA_ERR_OUT_OF_RESOURCES, PLASMA_ERR_UNEXPECTED, plasma_error(), plasma_fatal_error(), PLASMA_FLAT_HOUSEHOLDER, PLASMA_FUNC_CGELS, PLASMA_FUNC_CGESVD, PLASMA_FUNC_DGELS, PLASMA_FUNC_DGESVD, PLASMA_FUNC_SGELS, PLASMA_FUNC_SGESVD, PLASMA_FUNC_ZGELS, PLASMA_FUNC_ZGESVD, PLASMA_IB, PLASMA_NB, PLASMA_SUCCESS, and plasma_tune().

{
size_t size;
int status;
int IB, NB, MT, NT;
plasma = plasma_context_self();
if (plasma == NULL) {
plasma_fatal_error("plasma_alloc_ibnb", "PLASMA not initialized");
}
/* Tune NB & IB depending on M & N; Set IBNBSIZE */
status = plasma_tune(func, M, N, 0);
if (status != PLASMA_SUCCESS) {
plasma_error("plasma_alloc_ibnb", "plasma_tune() failed");
}
/* Set MT & NT & allocate */
NB = PLASMA_NB;
IB = PLASMA_IB;
MT = (M%NB==0) ? (M/NB) : (M/NB+1);
NT = (N%NB==0) ? (N/NB) : (N/NB+1);
/* Size is doubled for RH QR to store the reduction T */
(func == PLASMA_FUNC_SGELS ||
func == PLASMA_FUNC_DGELS ||
func == PLASMA_FUNC_CGELS ||
func == PLASMA_FUNC_ZGELS ||
func == PLASMA_FUNC_SGESVD ||
func == PLASMA_FUNC_DGESVD ||
func == PLASMA_FUNC_CGESVD ||
func == PLASMA_FUNC_ZGESVD ))
NT *= 2;
size = (size_t)MT*NT*IB*NB * plasma_element_size(type);
if (size <= 0) {
*memptr = NULL;
}
// status = posix_memalign(memptr, STANDARD_PAGE_SIZE, size);
*memptr = malloc(size);
// if (status != 0) {
if (*memptr == NULL) {
plasma_error("plasma_alloc_ibnb_tile", "malloc() failed");
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

int plasma_alloc_ibnb_tile ( int  M,
int  N,
PLASMA_enum  func,
int  type,
PLASMA_desc **  desc 
)

Definition at line 78 of file workspace.c.

References plasma_context_struct::householder, plasma_context_self(), plasma_desc_check(), plasma_desc_init(), plasma_desc_mat_alloc(), PLASMA_ERR_NOT_INITIALIZED, PLASMA_ERR_OUT_OF_RESOURCES, PLASMA_ERR_UNEXPECTED, plasma_error(), plasma_fatal_error(), PLASMA_FLAT_HOUSEHOLDER, PLASMA_FUNC_CGELS, PLASMA_FUNC_CGESVD, PLASMA_FUNC_DGELS, PLASMA_FUNC_DGESVD, PLASMA_FUNC_SGELS, PLASMA_FUNC_SGESVD, PLASMA_FUNC_ZGELS, PLASMA_FUNC_ZGESVD, PLASMA_IB, PLASMA_NB, PLASMA_SUCCESS, and plasma_tune().

{
int status;
int IB, NB, MT, NT;
plasma = plasma_context_self();
if (plasma == NULL) {
plasma_fatal_error("plasma_alloc_ibnb_tile", "PLASMA not initialized");
}
/* Tune NB & IB depending on M & N; Set IBNBSIZE */
status = plasma_tune(func, M, N, 0);
if (status != PLASMA_SUCCESS) {
plasma_error("plasma_alloc_ibnb_tile", "plasma_tune() failed");
}
/* Set MT & NT & allocate */
NB = PLASMA_NB;
IB = PLASMA_IB;
MT = (M%NB==0) ? (M/NB) : (M/NB+1);
NT = (N%NB==0) ? (N/NB) : (N/NB+1);
/* Size is doubled for RH QR to store the reduction T */
((func == PLASMA_FUNC_SGELS) ||
(func == PLASMA_FUNC_DGELS) ||
(func == PLASMA_FUNC_CGELS) ||
(func == PLASMA_FUNC_ZGELS) ||
(func == PLASMA_FUNC_SGESVD) ||
(func == PLASMA_FUNC_DGESVD) ||
(func == PLASMA_FUNC_CGESVD) ||
(func == PLASMA_FUNC_ZGESVD)))
NT *= 2;
/* Allocate and initialize descriptor */
*desc = (PLASMA_desc*)malloc(sizeof(PLASMA_desc));
if (*desc == NULL) {
plasma_error("plasma_alloc_ibnb_tile", "malloc() failed");
}
**desc = plasma_desc_init(type, IB, NB, IB*NB, MT*IB, NT*NB, 0, 0, MT*IB, NT*NB);
/* Allocate matrix */
if (plasma_desc_mat_alloc(*desc)) {
plasma_error("plasma_alloc_ibnb_tile", "malloc() failed");
}
/* Check that everything is ok */
status = plasma_desc_check(*desc);
if (status != PLASMA_SUCCESS) {
plasma_error("plasma_alloc_ibnb_tile", "invalid descriptor");
return status;
}
}

Here is the call graph for this function:

Here is the caller graph for this function:

int plasma_alloc_ipiv ( int  M,
int  N,
PLASMA_enum  func,
void **  memptr 
)

Definition at line 140 of file workspace.c.

References plasma_context_self(), PLASMA_ERR_NOT_INITIALIZED, PLASMA_ERR_OUT_OF_RESOURCES, PLASMA_ERR_UNEXPECTED, plasma_error(), plasma_fatal_error(), PLASMA_NB, PLASMA_SUCCESS, and plasma_tune().

{
size_t size;
int status;
int NB, MT, NT;
plasma = plasma_context_self();
if (plasma == NULL) {
plasma_fatal_error("plasma_alloc_ipiv", "PLASMA not initialized");
}
/* Tune NB & IB depending on M & N; Set IBNBSIZE */
status = plasma_tune(func, M, N, 0);
if (status != PLASMA_SUCCESS) {
plasma_error("plasma_alloc_ipiv", "plasma_tune() failed");
}
/* Set MT & NT & allocate */
NB = PLASMA_NB;
NT = (N%NB==0) ? (N/NB) : ((N/NB)+1);
MT = (M%NB==0) ? (M/NB) : ((M/NB)+1);
size = (size_t)MT*NT * NB * sizeof(int);
if (size <= 0) {
*memptr = NULL;
}
// status = posix_memalign(memptr, CACHE_LINE_SIZE, size);
*memptr = malloc(size);
// if (status != 0) {
if (*memptr == NULL) {
plasma_error("plasma_alloc_ipiv", "malloc() failed");
}
}

Here is the call graph for this function:

Here is the caller graph for this function: