Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Karsa Zoltán István
/
politopok
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
e1c5288c
authored
Feb 09, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused modules
parent
dfdf4126
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
22 deletions
+7
-22
epgpu.cu
+2
-2
genax.py
+2
-7
tetrarun.py
+3
-1
utils.py
+0
-12
No files found.
epgpu.cu
View file @
e1c5288c
...
@@ -291,8 +291,8 @@ __device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
...
@@ -291,8 +291,8 @@ __device__ void DAB_oldal(int v, int w, const vec3& C, const vec3& D, char* egys
}
}
}
}
__global__ void gpu_egyensulyi(int v, int w,
double* Cx_arr,
double* Cy_arr,
__global__ void gpu_egyensulyi(int v, int w,
const double* Cx_arr, const
double* Cy_arr,
double* Dx_arr, double* Dy_arr,
double* Dz_arr, int size_C, int size_D, int lcm, char* egysulyi_mtx) {
const double* Dx_arr, const double* Dy_arr, const
double* Dz_arr, int size_C, int size_D, int lcm, char* egysulyi_mtx) {
int pos = blockDim.x * blockIdx.x + threadIdx.x;
int pos = blockDim.x * blockIdx.x + threadIdx.x;
if (pos >= size_C*size_D)
if (pos >= size_C*size_D)
return;
return;
...
...
genax.py
View file @
e1c5288c
import
cupy
as
cp
,
matplotlib
.
pyplot
as
plt
import
cupy
as
cp
from
numba
import
cuda
from
numba
import
cuda
from
utils
import
expSpace
from
utils
import
expSpace
from
mpi
import
size
,
rank
from
mpi
import
size
,
rank
def
gen_angels_to_pick
(
n
,
plot
=
False
):
def
gen_angels_to_pick
(
n
):
if
n
%
2
==
0
:
if
n
%
2
==
0
:
raise
"n
%2
==0"
raise
"n
%2
==0"
N
=
int
((
n
+
3
)
/
2
)
N
=
int
((
n
+
3
)
/
2
)
...
@@ -14,11 +14,6 @@ def gen_angels_to_pick(n, plot = False):
...
@@ -14,11 +14,6 @@ def gen_angels_to_pick(n, plot = False):
anglestopick
=
cp
.
concatenate
((
X1
,
X3
),
axis
=
None
)
anglestopick
=
cp
.
concatenate
((
X1
,
X3
),
axis
=
None
)
anglestopick
=
cp
.
unique
(
anglestopick
)
# Vigyázni vele!
anglestopick
=
cp
.
unique
(
anglestopick
)
# Vigyázni vele!
anglestopick
=
anglestopick
[
1
:
-
1
]
anglestopick
=
anglestopick
[
1
:
-
1
]
if
plot
:
Y
=
cp
.
zeros
(
n
)
plt
.
plot
(
anglestopick
,
Y
,
'|'
)
plt
.
show
()
return
anglestopick
return
anglestopick
...
...
tetrarun.py
View file @
e1c5288c
...
@@ -37,12 +37,14 @@ def main(argv):
...
@@ -37,12 +37,14 @@ def main(argv):
elif
opt
in
(
"-m"
,
"--mpi"
):
elif
opt
in
(
"-m"
,
"--mpi"
):
mpi
=
True
mpi
=
True
space
=
gen_angels_to_pick
(
n
,
PLOT
)
space
=
gen_angels_to_pick
(
n
)
Cx
,
Cy
=
angles_alap
(
space
)
Cx
,
Cy
=
angles_alap
(
space
)
Dx
,
Dy
,
Dz
=
angles_ratet
(
space
,
mpi
)
Dx
,
Dy
,
Dz
=
angles_ratet
(
space
,
mpi
)
del
space
res
=
start_kernel
(
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
v
,
w
)
res
=
start_kernel
(
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
v
,
w
)
Cx_cpu
=
np
.
zeros
(
Cx
.
size
,
dtype
=
np
.
float64
)
Cx_cpu
=
np
.
zeros
(
Cx
.
size
,
dtype
=
np
.
float64
)
...
...
utils.py
View file @
e1c5288c
import
cupy
as
cp
import
cupy
as
cp
from
functools
import
wraps
import
time
import
time
import
numpy
as
np
import
numpy
as
np
from
mpi
import
size
,
rank
from
mpi
import
size
,
rank
...
@@ -12,17 +11,6 @@ ep_pontok_module = cp.RawModule(code=code, options=('--std=c++11',), name_expres
...
@@ -12,17 +11,6 @@ ep_pontok_module = cp.RawModule(code=code, options=('--std=c++11',), name_expres
exact_one_cuda
=
ep_pontok_module
.
get_function
(
kers
[
0
])
exact_one_cuda
=
ep_pontok_module
.
get_function
(
kers
[
0
])
filter_cuda
=
ep_pontok_module
.
get_function
(
kers
[
1
])
filter_cuda
=
ep_pontok_module
.
get_function
(
kers
[
1
])
def
timeit
(
func
):
@wraps
(
func
)
def
timeit_wrapper
(
*
args
,
**
kwargs
):
start_time
=
time
.
perf_counter
()
result
=
func
(
*
args
,
**
kwargs
)
end_time
=
time
.
perf_counter
()
total_time
=
end_time
-
start_time
print
(
f
'Function {func.__name__}{args} {kwargs} Took {total_time:.4f} seconds'
)
return
result
return
timeit_wrapper
def
expSpace
(
min
,
max
,
N
,
exponentialliness
=
20.0
):
def
expSpace
(
min
,
max
,
N
,
exponentialliness
=
20.0
):
LinVec
=
cp
.
linspace
(
0
,
cp
.
log10
(
exponentialliness
+
1
,
dtype
=
cp
.
float64
),
N
,
dtype
=
cp
.
float64
)
LinVec
=
cp
.
linspace
(
0
,
cp
.
log10
(
exponentialliness
+
1
,
dtype
=
cp
.
float64
),
N
,
dtype
=
cp
.
float64
)
return
(
max
-
min
)
/
exponentialliness
*
(
10.0
**
LinVec
-
1
)
+
min
return
(
max
-
min
)
/
exponentialliness
*
(
10.0
**
LinVec
-
1
)
+
min
...
...
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