Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dg
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
dg
Commits
ab8341ed
Commit
ab8341ed
authored
3 years ago
by
Marco D'Antonio
Committed by
Matteo Cicuttin
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removed unused GPU kernel code
(cherry picked from commit 8f1f09f5a048d51e146c2418581a62ed05b7b6b2)
parent
8eebe77a
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
src/libgmshdg/kernels_cuda.cu
+0
-14
0 additions, 14 deletions
src/libgmshdg/kernels_cuda.cu
tests/test_differentiation_gpu.cpp
+5
-44
5 additions, 44 deletions
tests/test_differentiation_gpu.cpp
with
5 additions
and
58 deletions
src/libgmshdg/kernels_cuda.cu
+
0
−
14
View file @
ab8341ed
...
@@ -138,19 +138,6 @@ launch_deriv_kernel(const entity_data_gpu& edg,
...
@@ -138,19 +138,6 @@ launch_deriv_kernel(const entity_data_gpu& edg,
using
KS
=
kernel_gpu_sizes
<
K
>
;
using
KS
=
kernel_gpu_sizes
<
K
>
;
#ifdef USE_BLOCKED_GPU_KERNELS
size_t
num_blocks
=
edg
.
num_all_elems
/
(
KS
::
cells_per_dblock
*
KS
::
parallel_dblocks
);
if
(
num_blocks
%
(
KS
::
cells_per_dblock
*
KS
::
parallel_dblocks
))
num_blocks
+=
1
;
dim3
grid_size
(
1
,
num_blocks
);
dim3
block_size
(
KS
::
dblock_size
,
KS
::
parallel_dblocks
);
if
(
edg
.
g_order
==
1
)
gpu_deriv_planar_blocked
<
K
><<<
grid_size
,
block_size
,
stream
>>>
(
f
,
J
,
Dtex
,
df_dx
,
df_dy
,
df_dz
,
num_elems
,
orients
,
edg
.
dof_base
);
//else
// compute_field_derivatives_kernel_curved<1>(ed, f, df_dx, df_dy, df_dz);
#else
auto
num_blocks
=
edg
.
num_bf
*
edg
.
num_all_elems
/
KS
::
deriv_threads
;
auto
num_blocks
=
edg
.
num_bf
*
edg
.
num_all_elems
/
KS
::
deriv_threads
;
if
(
edg
.
num_bf
*
edg
.
num_all_elems
%
KS
::
deriv_threads
)
if
(
edg
.
num_bf
*
edg
.
num_all_elems
%
KS
::
deriv_threads
)
num_blocks
+=
1
;
num_blocks
+=
1
;
...
@@ -160,7 +147,6 @@ launch_deriv_kernel(const entity_data_gpu& edg,
...
@@ -160,7 +147,6 @@ launch_deriv_kernel(const entity_data_gpu& edg,
Dtex
,
df_dx
,
df_dy
,
df_dz
,
alpha
,
num_elems
,
orients
,
edg
.
dof_base
);
Dtex
,
df_dx
,
df_dy
,
df_dz
,
alpha
,
num_elems
,
orients
,
edg
.
dof_base
);
//else
//else
// compute_field_derivatives_kernel_curved<1>(ed, f, df_dx, df_dy, df_dz);
// compute_field_derivatives_kernel_curved<1>(ed, f, df_dx, df_dy, df_dz);
#endif
}
}
void
void
...
...
This diff is collapsed.
Click to expand it.
tests/test_differentiation_gpu.cpp
+
5
−
44
View file @
ab8341ed
...
@@ -53,7 +53,7 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -53,7 +53,7 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
std
::
vector
<
double
>
sizes
({
0.32
,
0.16
,
0.08
,
0.04
});
std
::
vector
<
double
>
sizes
({
0.32
,
0.16
,
0.08
,
0.04
});
std
::
vector
<
double
>
errors
;
std
::
vector
<
double
>
errors
;
std
::
cout
<<
cyanfg
<<
"Testing geometric order "
<<
geometric_order
;
std
::
cout
<<
std
::
endl
<<
cyanfg
<<
"Testing geometric order "
<<
geometric_order
;
std
::
cout
<<
", approximation order = "
<<
approximation_order
<<
nofg
;
std
::
cout
<<
", approximation order = "
<<
approximation_order
<<
nofg
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
...
@@ -101,11 +101,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -101,11 +101,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
vecxd
Pdf_dz
=
vecxd
::
Zero
(
model_num_dofs
);
vecxd
Pdf_dz
=
vecxd
::
Zero
(
model_num_dofs
);
std
::
vector
<
entity_data_gpu
>
edgs
;
std
::
vector
<
entity_data_gpu
>
edgs
;
#ifdef USE_BLOCKED_GPU_KERNELS
std
::
vector
<
entity_data_cpu
>
eds
;
size_t
model_num_dofs_gpu
=
0
;
#else
size_t
model_num_dofs_gpu
=
model_num_dofs
;
size_t
model_num_dofs_gpu
=
model_num_dofs
;
#endif
#endif
for
(
auto
&
e
:
mod
)
for
(
auto
&
e
:
mod
)
...
@@ -117,24 +112,13 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -117,24 +112,13 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
entity_data_cpu
ed
;
entity_data_cpu
ed
;
e
.
populate_entity_data
(
ed
,
mod
);
e
.
populate_entity_data
(
ed
,
mod
);
entity_data_gpu
edg
(
ed
);
entity_data_gpu
edg
(
ed
);
#ifdef USE_BLOCKED_GPU_KERNELS
edg
.
dof_base
=
model_num_dofs_gpu
;
model_num_dofs_gpu
+=
gpu_dblocks_dofs
(
ed
);
eds
.
push_back
(
std
::
move
(
ed
)
);
#endif
edgs
.
push_back
(
std
::
move
(
edg
)
);
edgs
.
push_back
(
std
::
move
(
edg
)
);
}
}
/* Prepare I/O vectors and call kernel */
/* Prepare I/O vectors and call kernel */
#ifdef USE_BLOCKED_GPU_KERNELS
assert
(
eds
.
size
()
==
edgs
.
size
());
vecxd
Pf_reshaped
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
for
(
size_t
i
=
0
;
i
<
eds
.
size
();
i
++
)
reshape_dofs
(
eds
[
i
],
edgs
[
i
],
Pf
,
Pf_reshaped
,
true
);
texture_allocator
<
double
>
Pf_gpu
(
Pf_reshaped
.
data
(),
Pf_reshaped
.
size
());
#else
device_vector
<
double
>
Pf_gpu
(
Pf
.
data
(),
Pf
.
size
());
device_vector
<
double
>
Pf_gpu
(
Pf
.
data
(),
Pf
.
size
());
#endif
device_vector
<
double
>
df_dx_gpu
(
model_num_dofs_gpu
);
device_vector
<
double
>
df_dx_gpu
(
model_num_dofs_gpu
);
device_vector
<
double
>
df_dy_gpu
(
model_num_dofs_gpu
);
device_vector
<
double
>
df_dy_gpu
(
model_num_dofs_gpu
);
device_vector
<
double
>
df_dz_gpu
(
model_num_dofs_gpu
);
device_vector
<
double
>
df_dz_gpu
(
model_num_dofs_gpu
);
...
@@ -161,30 +145,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -161,30 +145,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
std
::
cout
<<
flops
/
(
1e9
*
time
)
<<
" GFlops/s"
<<
std
::
endl
;
std
::
cout
<<
flops
/
(
1e9
*
time
)
<<
" GFlops/s"
<<
std
::
endl
;
}
}
}
}
#ifdef USE_BLOCKED_GPU_KERNELS
vecxd
Cdf_dx_exp
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dy_exp
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dz_exp
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
df_dx_gpu
.
copyout
(
Cdf_dx_exp
.
data
()
);
df_dy_gpu
.
copyout
(
Cdf_dy_exp
.
data
()
);
df_dz_gpu
.
copyout
(
Cdf_dz_exp
.
data
()
);
vecxd
Cdf_dx
=
vecxd
::
Zero
(
model_num_dofs
);
vecxd
Cdf_dy
=
vecxd
::
Zero
(
model_num_dofs
);
vecxd
Cdf_dz
=
vecxd
::
Zero
(
model_num_dofs
);
assert
(
eds
.
size
()
==
edgs
.
size
());
Pf
=
vecxd
::
Zero
(
model_num_dofs
);
for
(
size_t
i
=
0
;
i
<
eds
.
size
();
i
++
)
{
reshape_dofs
(
eds
[
i
],
edgs
[
i
],
Cdf_dx_exp
,
Cdf_dx
,
false
);
reshape_dofs
(
eds
[
i
],
edgs
[
i
],
Cdf_dy_exp
,
Cdf_dy
,
false
);
reshape_dofs
(
eds
[
i
],
edgs
[
i
],
Cdf_dz_exp
,
Cdf_dz
,
false
);
reshape_dofs
(
eds
[
i
],
edgs
[
i
],
Pf_reshaped
,
Pf
,
false
);
}
#else
vecxd
Cdf_dx
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dx
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dy
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dy
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dz
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
vecxd
Cdf_dz
=
vecxd
::
Zero
(
model_num_dofs_gpu
);
...
@@ -192,7 +152,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -192,7 +152,6 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
df_dx_gpu
.
copyout
(
Cdf_dx
.
data
()
);
df_dx_gpu
.
copyout
(
Cdf_dx
.
data
()
);
df_dy_gpu
.
copyout
(
Cdf_dy
.
data
()
);
df_dy_gpu
.
copyout
(
Cdf_dy
.
data
()
);
df_dz_gpu
.
copyout
(
Cdf_dz
.
data
()
);
df_dz_gpu
.
copyout
(
Cdf_dz
.
data
()
);
#endif
double
err_x
=
0.0
;
double
err_x
=
0.0
;
double
err_y
=
0.0
;
double
err_y
=
0.0
;
...
@@ -247,6 +206,8 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
...
@@ -247,6 +206,8 @@ int test_differentiation_convergence(int geometric_order, int approximation_orde
errs_x
.
push_back
(
std
::
sqrt
(
err_x
)
);
errs_x
.
push_back
(
std
::
sqrt
(
err_x
)
);
errs_y
.
push_back
(
std
::
sqrt
(
err_y
)
);
errs_y
.
push_back
(
std
::
sqrt
(
err_y
)
);
errs_z
.
push_back
(
std
::
sqrt
(
err_z
)
);
errs_z
.
push_back
(
std
::
sqrt
(
err_z
)
);
std
::
cout
<<
std
::
endl
;
}
}
double
rate_x
=
0.0
;
double
rate_x
=
0.0
;
...
...
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