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
Commit
08d6cac9
authored
Feb 07, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy to host
parent
ada69672
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
26 deletions
+27
-26
tetrarun.py
+16
-2
utils.py
+11
-24
No files found.
tetrarun.py
View file @
08d6cac9
import
sys
,
getopt
import
sys
,
getopt
import
numpy
as
np
from
genax
import
gen_angels_to_pick
,
angles_alap
,
angles_ratet
from
genax
import
gen_angels_to_pick
,
angles_alap
,
angles_ratet
from
gpu
import
start_kernel
from
gpu
import
start_kernel
from
utils
import
convert
,
printresults
,
search
,
exact_one
,
exact_one_gpu
,
filter_gpu
,
writetofile
,
writetofile2
from
utils
import
convert
,
printresults
,
search
,
exact_one
,
exact_one_gpu
,
filter_gpu
,
writetofile
,
writetofile2
...
@@ -42,8 +42,22 @@ def main(argv):
...
@@ -42,8 +42,22 @@ def main(argv):
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
.
get
(
out
=
Cx_cpu
)
Cy_cpu
=
np
.
zeros
(
Cy
.
size
,
dtype
=
np
.
float64
)
Cy
.
get
(
out
=
Cy_cpu
)
Dx_cpu
=
np
.
zeros
(
Dx
.
size
,
dtype
=
np
.
float64
)
Dx
.
get
(
out
=
Dx_cpu
)
Dy_cpu
=
np
.
zeros
(
Dy
.
size
,
dtype
=
np
.
float64
)
Dy
.
get
(
out
=
Dy_cpu
)
Dz_cpu
=
np
.
zeros
(
Dz
.
size
,
dtype
=
np
.
float64
)
Dz
.
get
(
out
=
Dz_cpu
)
mtx_cpu
=
np
.
zeros
(
res
.
size
,
dtype
=
np
.
int8
)
.
reshape
(
res
.
shape
)
res
.
get
(
out
=
mtx_cpu
)
if
outputfile
:
if
outputfile
:
writetofile
(
outputfile
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
res
)
writetofile
(
outputfile
+
'.full'
,
Cx_cpu
,
Cy_cpu
,
Dx_cpu
,
Dy_cpu
,
Dz_cpu
,
mtx_cpu
)
writetofile2
(
outputfile
,
Cx_cpu
,
Cy_cpu
,
Dx_cpu
,
Dy_cpu
,
Dz_cpu
,
mtx_cpu
)
#printresults(res)
#printresults(res)
#print("Exact one 3-3")
#print("Exact one 3-3")
...
...
utils.py
View file @
08d6cac9
...
@@ -56,20 +56,14 @@ def printresults(egyensulyi_mtx):
...
@@ -56,20 +56,14 @@ def printresults(egyensulyi_mtx):
print
(
np
.
resize
(
parok
,
(
int
(
N
/
2
),
2
)))
print
(
np
.
resize
(
parok
,
(
int
(
N
/
2
),
2
)))
print
()
print
()
def
writetofile
(
filename
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
egyensulyi_mtx
):
def
writetofile
(
filename
,
Cx_cpu
,
Cy_cpu
,
Dx_cpu
,
Dy_cpu
,
Dz_cpu
,
mtx_cpu
):
lcm
=
compute_lcm
(
Cx
.
size
,
Dx
.
size
)
size_C
=
Cx_cpu
.
size
Cx_cpu
=
Cx
.
get
()
size_D
=
Dx_cpu
.
size
Cy_cpu
=
Cy
.
get
()
lcm
=
compute_lcm
(
size_C
,
size_D
)
Dx_cpu
=
Dx
.
get
()
pos
=
size_C
*
size_D
Dy_cpu
=
Dy
.
get
()
Dz_cpu
=
Dz
.
get
()
mtx_cpu
=
egyensulyi_mtx
.
get
()
pos
=
Cx
.
size
*
Dx
.
size
f
=
open
(
filename
,
"w"
)
f
=
open
(
filename
,
"w"
)
size_C
=
Cx
.
size
size_D
=
Dx
.
size
for
i
in
range
(
0
,
pos
):
for
i
in
range
(
0
,
pos
):
#parok = np.empty([0], dtype=np.int8)
#parok = np.empty([0], dtype=np.int8)
#for S in range(0, 4):
#for S in range(0, 4):
...
@@ -85,20 +79,13 @@ def writetofile(filename, Cx, Cy, Dx, Dy, Dz, egyensulyi_mtx):
...
@@ -85,20 +79,13 @@ def writetofile(filename, Cx, Cy, Dx, Dy, Dz, egyensulyi_mtx):
f
.
close
()
f
.
close
()
def
writetofile2
(
filename
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
egyensulyi_mtx
):
def
writetofile2
(
filename
,
Cx_cpu
,
Cy_cpu
,
Dx_cpu
,
Dy_cpu
,
Dz_cpu
,
mtx_cpu
):
lcm
=
compute_lcm
(
Cx
.
size
,
Dx
.
size
)
size_C
=
Cx_cpu
.
size
Cx_cpu
=
Cx
.
get
()
size_D
=
Dx_cpu
.
size
Cy_cpu
=
Cy
.
get
()
lcm
=
compute_lcm
(
size_C
,
size_D
)
Dx_cpu
=
Dx
.
get
()
pos
=
size_C
*
size_D
Dy_cpu
=
Dy
.
get
()
Dz_cpu
=
Dz
.
get
()
mtx_cpu
=
egyensulyi_mtx
.
get
()
pos
=
Cx
.
size
*
Dx
.
size
f
=
open
(
filename
,
"w"
)
f
=
open
(
filename
,
"w"
)
size_C
=
Cx
.
size
size_D
=
Dx
.
size
for
i
in
range
(
0
,
pos
):
for
i
in
range
(
0
,
pos
):
s
=
0
s
=
0
for
S
in
range
(
0
,
4
):
for
S
in
range
(
0
,
4
):
...
...
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