Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycuda
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Andreas Klöckner
pycuda
Commits
4b365ab3
Commit
4b365ab3
authored
15 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Support for host memory flags in PageLockedMemoryPool.
parent
d9eb807d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cpp/mempool.hpp
+2
-2
2 additions, 2 deletions
src/cpp/mempool.hpp
src/wrapper/mempool.cpp
+18
-2
18 additions, 2 deletions
src/wrapper/mempool.cpp
with
20 additions
and
4 deletions
src/cpp/mempool.hpp
+
2
−
2
View file @
4b365ab3
...
...
@@ -70,8 +70,8 @@ namespace pycuda
bool
m_stop_holding
;
public:
memory_pool
()
:
m_held_blocks
(
0
),
m_active_blocks
(
0
),
m_stop_holding
(
false
)
memory_pool
(
Allocator
const
&
alloc
=
Allocator
()
)
:
m_allocator
(
alloc
),
m_held_blocks
(
0
),
m_active_blocks
(
0
),
m_stop_holding
(
false
)
{
}
...
...
This diff is collapsed.
Click to expand it.
src/wrapper/mempool.cpp
+
18
−
2
View file @
4b365ab3
...
...
@@ -48,13 +48,20 @@ namespace
class
host_allocator
{
private:
unsigned
m_flags
;
public:
typedef
void
*
pointer_type
;
typedef
unsigned
int
size_type
;
host_allocator
(
unsigned
flags
=
0
)
:
m_flags
(
flags
)
{
}
pointer_type
allocate
(
size_type
s
)
{
return
cuda
::
mem_alloc_host
(
s
);
return
cuda
::
mem_alloc_host
(
s
,
m_flags
);
}
void
free
(
pointer_type
p
)
...
...
@@ -225,12 +232,21 @@ void pycuda_expose_tools()
expose_memory_pool
(
wrapper
);
}
{
typedef
host_allocator
cl
;
py
::
class_
<
cl
>
wrapper
(
"PageLockedAllocator"
,
py
::
init
<
py
::
optional
<
unsigned
>
>
());
}
{
typedef
pycuda
::
memory_pool
<
host_allocator
>
cl
;
py
::
class_
<
cl
,
boost
::
noncopyable
,
boost
::
shared_ptr
<
cl
>
>
wrapper
(
"PageLockedMemoryPool"
);
boost
::
shared_ptr
<
cl
>
>
wrapper
(
"PageLockedMemoryPool"
,
py
::
init
<
py
::
optional
<
host_allocator
const
&>
>
()
);
wrapper
.
def
(
"allocate"
,
host_pool_allocate
,
(
py
::
arg
(
"shape"
),
py
::
arg
(
"dtype"
),
py
::
arg
(
"order"
)
=
"C"
));
...
...
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