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
allocate.c File Reference
#include "common.h"
#include "allocate.h"
#include "auxiliary.h"
#include <stdlib.h>
Include dependency graph for allocate.c:

Go to the source code of this file.

Functions

void * plasma_shared_alloc (plasma_context_t *plasma, size_t size, int type)
void plasma_shared_free (plasma_context_t *plasma, void *ptr)
void * plasma_private_alloc (plasma_context_t *plasma, size_t size, int type)
void plasma_private_free (plasma_context_t *plasma, void *ptr)

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 allocate.c.


Function Documentation

void* plasma_private_alloc ( plasma_context_t plasma,
size_t  size,
int  type 
)

Definition at line 51 of file allocate.c.

References plasma_element_size(), and plasma_error().

{
void *memptr;
size *= plasma_element_size(type);
if (size <= 0)
return NULL;
//if (posix_memalign(&memptr, CACHE_LINE_SIZE, size) != 0) {
if ((memptr = malloc(size)) == NULL) {
plasma_error("plasma_private_alloc", "posix_memalign() failed");
return NULL;
}
return memptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plasma_private_free ( plasma_context_t plasma,
void *  ptr 
)

Definition at line 69 of file allocate.c.

{
if (ptr == NULL) // somewhat redundant - free() does the same
return;
free(ptr);
}

Here is the caller graph for this function:

void* plasma_shared_alloc ( plasma_context_t plasma,
size_t  size,
int  type 
)

Definition at line 23 of file allocate.c.

References plasma_element_size(), and plasma_error().

{
void *memptr;
size *= plasma_element_size(type);
if (size <= 0)
return NULL;
//if (posix_memalign(&memptr, STANDARD_PAGE_SIZE, size) != 0) {
if ((memptr = malloc(size)) == NULL) {
plasma_error("plasma_shared_alloc", "posix_memalign() failed");
return NULL;
}
return memptr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void plasma_shared_free ( plasma_context_t plasma,
void *  ptr 
)

Definition at line 41 of file allocate.c.

{
if (ptr == NULL) // somewhat redundant - free() does the same
return;
free(ptr);
}

Here is the caller graph for this function: