Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
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
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
llvm
hpvm-release
Commits
bd3cbd18
Commit
bd3cbd18
authored
9 years ago
by
Prakalp Srivastava
Browse files
Options
Downloads
Patches
Plain Diff
Fixed timers in lbm
parent
8f3c406e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/test/VISC/parboil/benchmarks/lbm/src/opencl_nvidia/main.c
+4
-3
4 additions, 3 deletions
...test/VISC/parboil/benchmarks/lbm/src/opencl_nvidia/main.c
llvm/test/VISC/parboil/benchmarks/lbm/src/visc/main.c
+8
-4
8 additions, 4 deletions
llvm/test/VISC/parboil/benchmarks/lbm/src/visc/main.c
with
12 additions
and
7 deletions
llvm/test/VISC/parboil/benchmarks/lbm/src/opencl_nvidia/main.c
+
4
−
3
View file @
bd3cbd18
...
@@ -147,13 +147,13 @@ void MAIN_initialize( const MAIN_Param* param, const OpenCL_Param* prm ) {
...
@@ -147,13 +147,13 @@ void MAIN_initialize( const MAIN_Param* param, const OpenCL_Param* prm ) {
LBM_initializeSpecialCellsForLDC
(
TEMP_srcGrid
);
LBM_initializeSpecialCellsForLDC
(
TEMP_srcGrid
);
LBM_initializeSpecialCellsForLDC
(
TEMP_dstGrid
);
LBM_initializeSpecialCellsForLDC
(
TEMP_dstGrid
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COPY
);
pb_SwitchToTimer
(
&
timers
,
visc_TimerID_SETUP
);
//Setup DEVICE datastructures
//Setup DEVICE datastructures
OpenCL_LBM_allocateGrid
(
prm
,
&
OpenCL_srcGrid
);
OpenCL_LBM_allocateGrid
(
prm
,
&
OpenCL_srcGrid
);
OpenCL_LBM_allocateGrid
(
prm
,
&
OpenCL_dstGrid
);
OpenCL_LBM_allocateGrid
(
prm
,
&
OpenCL_dstGrid
);
//Initialize DEVICE datastructures
//Initialize DEVICE datastructures
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COPY
);
OpenCL_LBM_initializeGrid
(
prm
,
OpenCL_srcGrid
,
TEMP_srcGrid
);
OpenCL_LBM_initializeGrid
(
prm
,
OpenCL_srcGrid
,
TEMP_srcGrid
);
OpenCL_LBM_initializeGrid
(
prm
,
OpenCL_dstGrid
,
TEMP_dstGrid
);
OpenCL_LBM_initializeGrid
(
prm
,
OpenCL_dstGrid
,
TEMP_dstGrid
);
...
@@ -182,6 +182,8 @@ void MAIN_finalize( const MAIN_Param* param, const OpenCL_Param* prm ) {
...
@@ -182,6 +182,8 @@ void MAIN_finalize( const MAIN_Param* param, const OpenCL_Param* prm ) {
LBM_storeVelocityField
(
TEMP_srcGrid
,
param
->
resultFilename
,
TRUE
);
LBM_storeVelocityField
(
TEMP_srcGrid
,
param
->
resultFilename
,
TRUE
);
LBM_freeGrid
(
(
float
**
)
&
TEMP_srcGrid
);
LBM_freeGrid
(
(
float
**
)
&
TEMP_srcGrid
);
pb_SwitchToTimer
(
&
timers
,
visc_TimerID_SETUP
);
OpenCL_LBM_freeGrid
(
OpenCL_srcGrid
);
OpenCL_LBM_freeGrid
(
OpenCL_srcGrid
);
OpenCL_LBM_freeGrid
(
OpenCL_dstGrid
);
OpenCL_LBM_freeGrid
(
OpenCL_dstGrid
);
...
@@ -189,7 +191,6 @@ void MAIN_finalize( const MAIN_Param* param, const OpenCL_Param* prm ) {
...
@@ -189,7 +191,6 @@ void MAIN_finalize( const MAIN_Param* param, const OpenCL_Param* prm ) {
clReleaseKernel
(
prm
->
clKernel
);
clReleaseKernel
(
prm
->
clKernel
);
clReleaseCommandQueue
(
prm
->
clCommandQueue
);
clReleaseCommandQueue
(
prm
->
clCommandQueue
);
clReleaseContext
(
prm
->
clContext
);
clReleaseContext
(
prm
->
clContext
);
}
}
void
OpenCL_initialize
(
OpenCL_Param
*
prm
)
void
OpenCL_initialize
(
OpenCL_Param
*
prm
)
...
...
This diff is collapsed.
Click to expand it.
llvm/test/VISC/parboil/benchmarks/lbm/src/visc/main.c
+
8
−
4
View file @
bd3cbd18
...
@@ -29,11 +29,11 @@ static LBM_Grid srcGrid, dstGrid;
...
@@ -29,11 +29,11 @@ static LBM_Grid srcGrid, dstGrid;
struct
pb_TimerSet
timers
;
struct
pb_TimerSet
timers
;
int
main
(
int
nArgs
,
char
*
arg
[]
)
{
int
main
(
int
nArgs
,
char
*
arg
[]
)
{
__visc__init
();
MAIN_Param
param
;
MAIN_Param
param
;
int
t
;
int
t
;
pb_InitializeTimerSet
(
&
timers
);
pb_InitializeTimerSet
(
&
timers
);
__visc__init
();
struct
pb_Parameters
*
params
;
struct
pb_Parameters
*
params
;
params
=
pb_ReadParameters
(
&
nArgs
,
arg
);
params
=
pb_ReadParameters
(
&
nArgs
,
arg
);
...
@@ -47,13 +47,16 @@ int main( int nArgs, char* arg[] ) {
...
@@ -47,13 +47,16 @@ int main( int nArgs, char* arg[] ) {
MAIN_initialize
(
&
param
);
MAIN_initialize
(
&
param
);
size_t
size
=
TOTAL_PADDED_CELLS
*
N_CELL_ENTRIES
*
sizeof
(
float
);
size_t
size
=
TOTAL_PADDED_CELLS
*
N_CELL_ENTRIES
*
sizeof
(
float
);
pb_SwitchToTimer
(
&
timers
,
visc_TimerID_MEM_TRACK
);
llvm_visc_track_mem
(
srcGrid
-
MARGIN
,
size
);
llvm_visc_track_mem
(
srcGrid
-
MARGIN
,
size
);
llvm_visc_track_mem
(
dstGrid
-
MARGIN
,
size
);
llvm_visc_track_mem
(
dstGrid
-
MARGIN
,
size
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COMPUTE
);
for
(
t
=
1
;
t
<=
param
.
nTimeSteps
;
t
++
)
{
for
(
t
=
1
;
t
<=
param
.
nTimeSteps
;
t
++
)
{
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_
KER
NE
L
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_
NO
NE
);
MAIN_performStreamCollide
(
srcGrid
,
dstGrid
);
MAIN_performStreamCollide
(
srcGrid
,
dstGrid
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COMPUTE
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COMPUTE
);
LBM_swapGrids
(
&
srcGrid
,
&
dstGrid
);
LBM_swapGrids
(
&
srcGrid
,
&
dstGrid
);
...
@@ -65,8 +68,11 @@ int main( int nArgs, char* arg[] ) {
...
@@ -65,8 +68,11 @@ int main( int nArgs, char* arg[] ) {
#endif
#endif
}
}
}
}
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COPY
);
llvm_visc_request_mem
(
srcGrid
-
MARGIN
,
size
);
llvm_visc_request_mem
(
srcGrid
-
MARGIN
,
size
);
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COMPUTE
);
MAIN_finalize
(
&
param
);
MAIN_finalize
(
&
param
);
pb_SwitchToTimer
(
&
timers
,
visc_TimerID_MEM_UNTRACK
);
pb_SwitchToTimer
(
&
timers
,
visc_TimerID_MEM_UNTRACK
);
...
@@ -319,7 +325,6 @@ __attribute__((noinline)) void MAIN_performStreamCollide( LBM_Grid src, LBM_Grid
...
@@ -319,7 +325,6 @@ __attribute__((noinline)) void MAIN_performStreamCollide( LBM_Grid src, LBM_Grid
unsigned
dimBlock
[
3
]
=
{
SIZE_X
,
1
,
1
};
unsigned
dimBlock
[
3
]
=
{
SIZE_X
,
1
,
1
};
unsigned
dimGrid
[
3
]
=
{
SIZE_X
*
SIZE_Y
,
SIZE_Z
,
1
};
unsigned
dimGrid
[
3
]
=
{
SIZE_X
*
SIZE_Y
,
SIZE_Z
,
1
};
size_t
size
=
TOTAL_PADDED_CELLS
*
N_CELL_ENTRIES
*
sizeof
(
float
);
size_t
size
=
TOTAL_PADDED_CELLS
*
N_CELL_ENTRIES
*
sizeof
(
float
);
unsigned
lbmDFG
=
__visc__node
(
performStreamCollide_kernel
,
2
,
3
,
dimBlock
[
0
],
dimBlock
[
1
],
dimBlock
[
2
],
dimGrid
[
0
]
/
dimBlock
[
0
],
dimGrid
[
1
]
/
dimBlock
[
1
],
dimGrid
[
2
]
/
dimBlock
[
2
],
4
,
src
-
MARGIN
,
size
,
dst
-
MARGIN
,
size
,
0
);
unsigned
lbmDFG
=
__visc__node
(
performStreamCollide_kernel
,
2
,
3
,
dimBlock
[
0
],
dimBlock
[
1
],
dimBlock
[
2
],
dimGrid
[
0
]
/
dimBlock
[
0
],
dimGrid
[
1
]
/
dimBlock
[
1
],
dimGrid
[
2
]
/
dimBlock
[
2
],
4
,
src
-
MARGIN
,
size
,
dst
-
MARGIN
,
size
,
0
);
__visc__wait
(
lbmDFG
);
__visc__wait
(
lbmDFG
);
...
@@ -356,7 +361,6 @@ void MAIN_finalize( const MAIN_Param* param ) {
...
@@ -356,7 +361,6 @@ void MAIN_finalize( const MAIN_Param* param ) {
//Setup TEMP datastructures
//Setup TEMP datastructures
pb_SwitchToTimer
(
&
timers
,
pb_TimerID_COMPUTE
);
LBM_showGridStatistics
(
srcGrid
);
LBM_showGridStatistics
(
srcGrid
);
LBM_storeVelocityField
(
srcGrid
,
param
->
resultFilename
,
TRUE
);
LBM_storeVelocityField
(
srcGrid
,
param
->
resultFilename
,
TRUE
);
...
...
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