PLASMA
2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
Main Page
Modules
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
async.c
Go to the documentation of this file.
1
14
#include "
common.h
"
15
16
#include <stdlib.h>
17
18
/***************************************************************************/
21
int
plasma_request_fail
(
PLASMA_sequence
*sequence,
PLASMA_request
*request,
int
status)
22
{
23
sequence->
request
= request;
24
sequence->
status
= status;
25
request->
status
= status;
26
return
status;
27
}
28
29
/***************************************************************************/
32
int
plasma_sequence_create
(
plasma_context_t
*
plasma
,
PLASMA_sequence
**sequence)
33
{
34
if
((*sequence = malloc(
sizeof
(
PLASMA_sequence
))) == NULL) {
35
plasma_error
(
"PLASMA_Sequence_Create"
,
"malloc() failed"
);
36
return
PLASMA_ERR_OUT_OF_RESOURCES
;
37
}
38
if
(((*sequence)->quark_sequence =
QUARK_Sequence_Create
(plasma->
quark
)) == NULL){
39
plasma_error
(
"PLASMA_Sequence_Create"
,
"QUARK_Sequence_Create() failed"
);
40
return
PLASMA_ERR_OUT_OF_RESOURCES
;
41
}
42
(*sequence)->status =
PLASMA_SUCCESS
;
43
return
PLASMA_SUCCESS
;
44
}
45
46
/***************************************************************************/
49
int
plasma_sequence_destroy
(
plasma_context_t
*
plasma
,
PLASMA_sequence
*sequence)
50
{
51
QUARK_Sequence_Destroy
(plasma->
quark
, sequence->
quark_sequence
);
52
free(sequence);
53
return
PLASMA_SUCCESS
;
54
}
55
56
/***************************************************************************/
59
int
plasma_sequence_wait
(
plasma_context_t
*
plasma
,
PLASMA_sequence
*sequence)
60
{
61
QUARK_Sequence_Wait
(plasma->
quark
, sequence->
quark_sequence
);
62
return
PLASMA_SUCCESS
;
63
}
64
65
/***************************************************************************/
68
void
plasma_sequence_flush
(
Quark
*quark,
PLASMA_sequence
*sequence,
PLASMA_request
*request,
int
status)
69
{
70
sequence->
request
= request;
71
sequence->
status
= status;
72
request->
status
= status;
73
QUARK_Sequence_Cancel
(quark, sequence->
quark_sequence
);
74
}
75
76
/***************************************************************************/
93
int
PLASMA_Sequence_Create
(
PLASMA_sequence
**sequence)
94
{
95
plasma_context_t
*
plasma
;
96
int
status;
97
98
plasma =
plasma_context_self
();
99
if
(plasma == NULL) {
100
plasma_fatal_error
(
"PLASMA_Sequence_Create"
,
"PLASMA not initialized"
);
101
return
PLASMA_ERR_NOT_INITIALIZED
;
102
}
103
status =
plasma_sequence_create
(plasma, sequence);
104
return
status;
105
}
106
107
/***************************************************************************/
124
int
PLASMA_Sequence_Destroy
(
PLASMA_sequence
*sequence)
125
{
126
plasma_context_t
*
plasma
;
127
int
status;
128
129
plasma =
plasma_context_self
();
130
if
(plasma == NULL) {
131
plasma_fatal_error
(
"PLASMA_Sequence_Destroy"
,
"PLASMA not initialized"
);
132
return
PLASMA_ERR_NOT_INITIALIZED
;
133
}
134
if
(sequence == NULL) {
135
plasma_fatal_error
(
"PLASMA_Sequence_Destroy"
,
"NULL sequence"
);
136
return
PLASMA_ERR_UNALLOCATED
;
137
}
138
status =
plasma_sequence_destroy
(plasma, sequence);
139
return
status;
140
}
141
142
/***************************************************************************/
159
int
PLASMA_Sequence_Wait
(
PLASMA_sequence
*sequence)
160
{
161
plasma_context_t
*
plasma
;
162
int
status;
163
164
plasma =
plasma_context_self
();
165
if
(plasma == NULL) {
166
plasma_fatal_error
(
"PLASMA_Sequence_Wait"
,
"PLASMA not initialized"
);
167
return
PLASMA_ERR_NOT_INITIALIZED
;
168
}
169
if
(sequence == NULL) {
170
plasma_fatal_error
(
"PLASMA_Sequence_Wait"
,
"NULL sequence"
);
171
return
PLASMA_ERR_UNALLOCATED
;
172
}
173
status =
plasma_sequence_wait
(plasma, sequence);
174
return
status;
175
}
176
177
/***************************************************************************/
197
int
PLASMA_Sequence_Flush
(
PLASMA_sequence
*sequence,
PLASMA_request
*request)
198
{
199
plasma_context_t
*
plasma
;
200
201
plasma =
plasma_context_self
();
202
if
(plasma == NULL) {
203
plasma_fatal_error
(
"PLASMA_Sequence_Flush"
,
"PLASMA not initialized"
);
204
return
PLASMA_ERR_NOT_INITIALIZED
;
205
}
206
if
(sequence == NULL) {
207
plasma_fatal_error
(
"PLASMA_Sequence_Flush"
,
"NULL sequence"
);
208
return
PLASMA_ERR_UNALLOCATED
;
209
}
210
plasma_sequence_flush
(plasma->
quark
, sequence, request,
PLASMA_ERR_SEQUENCE_FLUSHED
);
211
return
PLASMA_SUCCESS
;
212
}
plasma_2.4.5
control
async.c
Generated on Mon Jul 9 2012 12:44:58 for PLASMA by
1.8.1