Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
openfpm_devices
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openfpm
openfpm_devices
Commits
c751d466
Commit
c751d466
authored
Aug 17, 2018
by
incardon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modification for GPU
parent
b96cc98b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
1 deletion
+42
-1
src/memory/CudaMemory.cu
src/memory/CudaMemory.cu
+21
-1
src/memory/CudaMemory.cuh
src/memory/CudaMemory.cuh
+3
-0
src/memory/ExtPreAlloc.hpp
src/memory/ExtPreAlloc.hpp
+3
-0
src/memory/HeapMemory.cpp
src/memory/HeapMemory.cpp
+1
-0
src/memory/HeapMemory.hpp
src/memory/HeapMemory.hpp
+3
-0
src/memory/PtrMemory.hpp
src/memory/PtrMemory.hpp
+3
-0
src/memory/memory.hpp
src/memory/memory.hpp
+8
-0
No files found.
src/memory/CudaMemory.cu
View file @
c751d466
...
...
@@ -276,6 +276,25 @@ void CudaMemory::deviceToHost()
CUDA_SAFE_CALL
(
cudaMemcpy
(
hm
,
dm
,
sz
,
cudaMemcpyDeviceToHost
));
}
/*! \brief Return a readable pointer with your data
*
* \return a readable pointer with your data
*
*/
void
CudaMemory
::
deviceToHost
(
size_t
start
,
size_t
stop
)
{
// allocate an host memory if not allocated
if
(
hm
==
NULL
)
allocate_host
(
sz
);
//! copy from device to host memory
CUDA_SAFE_CALL
(
cudaMemcpy
(((
unsigned
char
*
)
hm
)
+
start
,((
unsigned
char
*
)
dm
)
+
start
,(
stop
-
start
),
cudaMemcpyDeviceToHost
));
}
/*! \brief Return a readable pointer with your data
*
* \return a readable pointer with your data
...
...
@@ -302,7 +321,8 @@ const void * CudaMemory::getPointer() const
void
CudaMemory
::
fill
(
unsigned
char
c
)
{
CUDA_SAFE_CALL
(
cudaMemset
(
dm
,
c
,
size
()));
memset
(
hm
,
c
,
size
());
if
(
hm
!=
NULL
)
{
memset
(
hm
,
c
,
size
());}
}
/*! \brief Return the CUDA device pointer
...
...
src/memory/CudaMemory.cuh
View file @
c751d466
...
...
@@ -92,6 +92,9 @@ public:
//! Move memory from device to host
virtual
void
deviceToHost
();
//! Move memory from device to host, just one chunk
virtual
void
deviceToHost
(
size_t
start
,
size_t
stop
);
//! get the device pointer, but do not copy the memory from host to device
virtual
void
*
getDevicePointerNoCopy
();
...
...
src/memory/ExtPreAlloc.hpp
View file @
c751d466
...
...
@@ -180,6 +180,9 @@ public:
//! Do nothing
virtual
void
deviceToHost
(){};
//! Do nothing
virtual
void
deviceToHost
(
size_t
start
,
size_t
stop
)
{};
/*! \brief Return the pointer of the last allocation
*
* \return the pointer
...
...
src/memory/HeapMemory.cpp
View file @
c751d466
...
...
@@ -18,6 +18,7 @@ static const int extra_pad = 512;
#include "Memleak_check.hpp"
#endif
/*! \brief fill host and device memory with the selected byte
*
* \param byte to fill
...
...
src/memory/HeapMemory.hpp
View file @
c751d466
...
...
@@ -96,6 +96,9 @@ public:
//! Do nothing
virtual
void
deviceToHost
(){};
//! Do nothing
virtual
void
deviceToHost
(
size_t
start
,
size_t
stop
)
{};
//! Increment the reference counter
virtual
void
incRef
()
{
ref_cnt
++
;}
...
...
src/memory/PtrMemory.hpp
View file @
c751d466
...
...
@@ -88,6 +88,9 @@ public:
//! Do nothing
virtual
void
deviceToHost
(){};
//! Do nothing
virtual
void
deviceToHost
(
size_t
start
,
size_t
stop
)
{};
/*! \brief fill memory with the selected byte
*
*
...
...
src/memory/memory.hpp
View file @
c751d466
...
...
@@ -131,6 +131,14 @@ class memory
*/
virtual
void
deviceToHost
()
=
0
;
/*! \brief Copy the memory from device to host
*
* \param start from start
* \param stop to stop
*
*/
virtual
void
deviceToHost
(
size_t
start
,
size_t
stop
)
=
0
;
/*! \brief Get the device pointer (Do not copy from host to device)
*
*
...
...
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