Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
aml
Commits
da621ae6
Commit
da621ae6
authored
Dec 03, 2020
by
Nicolas Denoyelle
Committed by
Swann Perarnau
Dec 03, 2020
Browse files
Default dma for linux
parent
2910ba2c
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/aml.h
View file @
da621ae6
...
...
@@ -46,7 +46,6 @@
////////////////////////////////////////////////////////////////////////////////
/**
* @}
* @defgroup aml "AML Library functions"
* @brief Initialize/Finalize library.
*
...
...
include/aml/dma/linux-par.h
View file @
da621ae6
...
...
@@ -27,6 +27,11 @@
**/
extern
struct
aml_dma_ops
aml_dma_linux_par_ops
;
/**
* Default parallel linux dma initialized at aml_init().
**/
extern
struct
aml_dma
*
aml_dma_linux_parallel
;
/** Inside of a parallel request for linux movement. **/
struct
aml_dma_request_linux_par
{
/**
...
...
include/aml/dma/linux-seq.h
View file @
da621ae6
...
...
@@ -27,6 +27,11 @@
**/
extern
struct
aml_dma_ops
aml_dma_linux_seq_ops
;
/**
* Default sequential linux dma initialized at aml_init().
**/
extern
struct
aml_dma
*
aml_dma_linux_sequential
;
/** Inside of a sequential request for linux movement. **/
struct
aml_dma_request_linux_seq
{
/**
...
...
src/aml.c
View file @
da621ae6
...
...
@@ -14,6 +14,9 @@
#include
"aml.h"
#include
"aml/dma/linux-par.h"
#include
"aml/dma/linux-seq.h"
const
int
aml_version_major
=
AML_VERSION_MAJOR
;
const
int
aml_version_minor
=
AML_VERSION_MINOR
;
const
int
aml_version_patch
=
AML_VERSION_PATCH
;
...
...
@@ -21,6 +24,9 @@ const char *aml_version_string = AML_VERSION_STRING;
int
aml_errno
;
struct
aml_dma
*
aml_dma_linux_sequential
;
struct
aml_dma
*
aml_dma_linux_parallel
;
#if HAVE_HWLOC == 1
#include
<hwloc.h>
...
...
@@ -52,11 +58,22 @@ int aml_topology_init(void)
int
aml_init
(
int
*
argc
,
char
**
argv
[])
{
int
err
;
// disable warnings
(
void
)
argc
;
(
void
)
argv
;
// Initialize topology
// Initialize dma
err
=
aml_dma_linux_seq_create
(
&
aml_dma_linux_sequential
,
64
,
NULL
,
NULL
);
if
(
err
!=
AML_SUCCESS
)
goto
err_with_linux_seq_dma
;
err
=
aml_dma_linux_par_create
(
&
aml_dma_linux_parallel
,
64
,
NULL
,
NULL
);
if
(
err
!=
AML_SUCCESS
)
goto
err_with_linux_par_dma
;
// Initialize topology
#if HAVE_HWLOC == 1
int
err_hwloc
;
err_hwloc
=
aml_topology_init
();
...
...
@@ -66,10 +83,18 @@ int aml_init(int *argc, char **argv[])
#endif
return
0
;
err_with_linux_par_dma:
aml_dma_linux_seq_destroy
(
&
aml_dma_linux_sequential
);
err_with_linux_seq_dma:
return
err
;
}
int
aml_finalize
(
void
)
{
aml_dma_linux_seq_destroy
(
&
aml_dma_linux_sequential
);
aml_dma_linux_par_destroy
(
&
aml_dma_linux_parallel
);
// Destroy topology
#if HAVE_HWLOC == 1
hwloc_topology_destroy
(
aml_topology
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment