Skip to content
GitLab
Menu
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
be757670
Commit
be757670
authored
Jul 08, 2020
by
Swann Perarnau
Browse files
Merge branch 'layout_cuda_fix' into 'staging'
Layout cuda fix See merge request
!137
parents
04254cf6
2d3cc234
Pipeline
#10726
passed with stages
in 3 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/aml/layout/cuda.h
View file @
be757670
...
...
@@ -30,8 +30,6 @@
* @{
**/
#include <aml/area/cuda.h>
/** aml_layout data structure **/
struct
aml_layout_cuda_data
{
/** Pointer to data on device. **/
...
...
src/layout/cuda.c
View file @
be757670
...
...
@@ -25,31 +25,21 @@ int aml_layout_cuda_create(struct aml_layout **out,
struct
aml_layout
*
layout
;
struct
aml_layout_cuda_data
*
layout_data
;
layout
=
AML_INNER_MALLOC_EXTRA
(
struct
aml_layout
,
struct
aml_layout_cuda_data
,
size_t
,
3
*
ndims
);
layout
=
AML_INNER_MALLOC_ARRAY
(
3
*
ndims
,
size_t
,
struct
aml_layout
,
struct
aml_layout_cuda_data
);
if
(
layout
==
NULL
)
return
-
AML_ENOMEM
;
layout_data
=
AML_INNER_MALLOC_NEXTPTR
(
layout
,
struct
aml_layout
,
struct
aml_layout_cuda_data
);
layout_data
=
AML_INNER_MALLOC_GET_FIELD
(
layout
,
2
,
struct
aml_layout
,
struct
aml_layout_cuda_data
);
layout_data
->
device_ptr
=
device_ptr
;
layout_data
->
order
=
order
;
layout_data
->
ndims
=
ndims
;
layout_data
->
dims
=
AML_INNER_MALLOC_EXTRA_NEXTPTR
(
layout
,
struct
aml_layout
,
struct
aml_layout_cuda_data
,
size_t
,
0
);
layout_data
->
stride
=
AML_INNER_MALLOC_EXTRA_NEXTPTR
(
layout
,
struct
aml_layout
,
struct
aml_layout_cuda_data
,
size_t
,
ndims
);
layout_data
->
cpitch
=
AML_INNER_MALLOC_EXTRA_NEXTPTR
(
layout
,
struct
aml_layout
,
struct
aml_layout_cuda_data
,
size_t
,
ndims
*
2
);
layout_data
->
dims
=
AML_INNER_MALLOC_GET_ARRAY
(
layout
,
size_t
,
struct
aml_layout
,
struct
aml_layout_cuda_data
);
layout_data
->
stride
=
layout_data
->
dims
+
ndims
;
layout_data
->
cpitch
=
layout_data
->
stride
+
ndims
;
// Store dims, stride and cpitch are internally stored in fortran
// row major.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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