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
Houman Mirzaalian Dastjerdi
waLBerla
Commits
e1bfee69
Commit
e1bfee69
authored
Jun 28, 2018
by
Houman Mirzaalian Dastjerdi
Browse files
CUDA_ComplexGeometry
- tmpPdf - numFluidCells
parent
3bec9d9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/benchmarks/CUDA_ComplexGeometryList/CUDA_ComplexGeometryList.h
View file @
e1bfee69
...
...
@@ -53,16 +53,21 @@ namespace walberla {
class
ListOnGpu
{
public:
typedef
Index_T
index_t
;
ListOnGpu
()
:
pdfs_
(
nullptr
),
pullIdxs_
(
nullptr
),
size_
(
0
)
{}
ListOnGpu
()
:
pdfs_
(
nullptr
),
tmpPdfs_
(
nullptr
),
pullIdxs_
(
nullptr
),
size_
(
0
)
,
numFluidCells_
(
0
)
{}
~
ListOnGpu
()
{};
void
resize
(
const
size_t
newSize
)
{
void
resize
(
const
size_t
newSize
,
const
uint_t
newNumFluidCells
)
{
cudaFree
(
pdfs_
);
cudaFree
(
tmpPdfs_
);
cudaFree
(
pullIdxs_
);
cudaMalloc
(
&
pdfs_
,
sizeof
(
real_t
)
*
newSize
);
cudaMalloc
(
&
tmpPdfs_
,
sizeof
(
real_t
)
*
newSize
);
cudaMalloc
(
&
pullIdxs_
,
sizeof
(
Index_T
)
*
newSize
);
size_
=
newSize
;
numFluidCells_
=
newNumFluidCells
;
//free old ptr and reallocate
...
...
@@ -72,17 +77,26 @@ namespace walberla {
const
real_t
*
getPdfData
()
const
{
return
pdfs_
;
}
real_t
*
getTmpPdfData
()
{
return
tmpPdfs_
;
}
const
real_t
*
getTmpPdfData
()
const
{
return
tmpPdfs_
;
}
Index_T
*
getPullIndicesData
()
{
return
pullIdxs_
;
}
const
Index_T
*
getPullIndicesData
()
const
{
return
pullIdxs_
;
}
size_t
getSize
()
const
{
return
size_
;
}
size_t
getNumFluidCells
()
const
{
return
numFluidCells_
;
}
private:
real_t
*
pdfs_
;
real_t
*
tmpPdfs_
;
Index_T
*
pullIdxs_
;
size_t
size_
;
uint_t
numFluidCells_
;
};
template
<
typename
Index_T
>
...
...
@@ -101,6 +115,7 @@ namespace walberla {
auto
pdfs_cpu
=
src
.
getPdfData
();
auto
pullIdxs_cpu
=
src
.
getPullIndicesData
();
auto
size_cpu
=
src
.
getSize
();
auto
size_FluidCells
=
src
.
getNumFluidCells
();
auto
pdfs_gpu
=
dst
.
getPdfData
();
...
...
@@ -110,7 +125,7 @@ namespace walberla {
if
(
size_cpu
!=
size_gpu
){
dst
.
resize
(
size_cpu
);
dst
.
resize
(
size_cpu
,
size_FluidCells
);
}
// check if size matches, if not reallocate
...
...
src/lbm/list/List.h
View file @
e1bfee69
...
...
@@ -243,6 +243,9 @@ public:
real_t
*
getPdfData
()
{
return
pdfs_
.
data
();
}
const
real_t
*
getPdfData
()
const
{
return
pdfs_
.
data
();
}
real_t
*
getTmpPdfData
()
{
return
tmpPdfs_
.
data
();
}
const
real_t
*
getTmpPdfData
()
const
{
return
tmpPdfs_
.
data
();
}
Index_T
*
getPullIndicesData
()
{
return
pullIdxs_
.
data
();
}
const
Index_T
*
getPullIndicesData
()
const
{
return
pullIdxs_
.
data
();
}
...
...
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