Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yaxt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dkrz-sw
yaxt
Commits
952d1755
Commit
952d1755
authored
1 year ago
by
Xingran Wang
Browse files
Options
Downloads
Patches
Plain Diff
add wrapper for openacc functions
parent
8291446b
No related branches found
Branches containing commit
Tags
v0.1.2
Tags containing commit
1 merge request
!22
fix memory leak in yaxt new exchanger
Pipeline
#52122
passed
1 year ago
Stage: tests
Stage: coverage
Stage: documentation
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xt_cuda.c
+20
-0
20 additions, 0 deletions
src/xt_cuda.c
with
20 additions
and
0 deletions
src/xt_cuda.c
+
20
−
0
View file @
952d1755
...
...
@@ -54,7 +54,10 @@
#include
<stdbool.h>
#include
<stdio.h>
#include
<string.h>
#if defined __NVCOMPILER && (__NVCOMPILER_MAJOR__ <= 22 || \
__NVCOMPILER_MAJOR__ == 23 && __NVCOMPILER_MINOR__ <= 9)
#include
<openacc.h>
#endif
#include
"core/core.h"
#include
"core/ppm_xfuncs.h"
...
...
@@ -122,7 +125,16 @@ static void * xt_cuda_malloc(
case
(
XT_MEMTYPE_HOST
):
return
xmalloc
(
alloc_size
);
case
(
XT_MEMTYPE_DEVICE
):
{
#if defined __NVCOMPILER && (__NVCOMPILER_MAJOR__ <= 22 || \
__NVCOMPILER_MAJOR__ == 23 && __NVCOMPILER_MINOR__ <= 9)
return
(
void
*
)
acc_malloc
(
MAX
(
alloc_size
,
1
));
#else
Xt_abort
(
Xt_default_comm
,
"ERROR(xt_cuda_malloc): missing OpenACC memory management support"
,
filename
,
__LINE__
);
return
NULL
;
#endif
}
}
}
...
...
@@ -140,7 +152,15 @@ static void xt_cuda_free(void * ptr, enum xt_memtype memtype) {
free
(
ptr
);
break
;
case
(
XT_MEMTYPE_DEVICE
):
#if defined __NVCOMPILER && (__NVCOMPILER_MAJOR__ <= 22 || \
__NVCOMPILER_MAJOR__ == 23 && __NVCOMPILER_MINOR__ <= 9)
acc_free
(
ptr
);
#else
Xt_abort
(
Xt_default_comm
,
"ERROR(xt_cuda_free): missing OpenACC memory management support"
,
filename
,
__LINE__
);
#endif
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment