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
865dbc07
authored
Jan 25, 2023
by
Zoltan Karsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
size
parent
8f302c12
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
genax.py
+4
-2
gpu.py
+1
-1
No files found.
genax.py
View file @
865dbc07
...
@@ -26,6 +26,8 @@ extern "C"
...
@@ -26,6 +26,8 @@ extern "C"
__global__
__global__
void parosit(const double* x1, const double* x2, double* a, double* b, const int m, const double PI) {
void parosit(const double* x1, const double* x2, double* a, double* b, const int m, const double PI) {
int tid = blockDim.x * blockIdx.x + threadIdx.x;
int tid = blockDim.x * blockIdx.x + threadIdx.x;
if (m <= tid || m*m <= tid*m+m-1)
return;
float alpha = x1[tid];
float alpha = x1[tid];
if (m*m <= tid*m+m-1)
if (m*m <= tid*m+m-1)
return;
return;
...
@@ -47,9 +49,9 @@ extern "C"
...
@@ -47,9 +49,9 @@ extern "C"
__global__
__global__
void parosit2(const double* x1, const double* x2, double* a, double* b, const int m, const double PI) {
void parosit2(const double* x1, const double* x2, double* a, double* b, const int m, const double PI) {
int tid = blockDim.x * blockIdx.x + threadIdx.x;
int tid = blockDim.x * blockIdx.x + threadIdx.x;
float alpha = x1[tid];
if (m <= tid || m*m <= tid*m+m-1)
if (m*m <= tid*m+m-1)
return;
return;
float alpha = x1[tid];
for (int i = 0; i < m; i++) {
for (int i = 0; i < m; i++) {
float betha = x2[i];
float betha = x2[i];
if ((alpha + betha) < PI && alpha > 0.0) {
if ((alpha + betha) < PI && alpha > 0.0) {
...
...
gpu.py
View file @
865dbc07
...
@@ -9,7 +9,7 @@ ep_pontok_module = cp.RawModule(code=code, options=('--std=c++11',), name_expres
...
@@ -9,7 +9,7 @@ ep_pontok_module = cp.RawModule(code=code, options=('--std=c++11',), name_expres
fun
=
ep_pontok_module
.
get_function
(
kers
[
0
])
fun
=
ep_pontok_module
.
get_function
(
kers
[
0
])
def
start_kernel
(
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
v
,
w
):
def
start_kernel
(
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
v
,
w
):
print
(
"Res size (byte): "
,
Cx
.
size
*
Dx
.
size
*
4
*
4
)
egyensulyi_mtx
=
cp
.
zeros
((
Cx
.
size
*
Dx
.
size
,
4
,
4
),
dtype
=
cp
.
int8
)
egyensulyi_mtx
=
cp
.
zeros
((
Cx
.
size
*
Dx
.
size
,
4
,
4
),
dtype
=
cp
.
int8
)
numBlock
=
int
((
Cx
.
size
*
Dx
.
size
+
256
-
1
)
/
256
)
numBlock
=
int
((
Cx
.
size
*
Dx
.
size
+
256
-
1
)
/
256
)
fun
((
numBlock
,),
(
256
,),
(
v
,
w
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
Cx
.
size
,
Dx
.
size
,
egyensulyi_mtx
))
fun
((
numBlock
,),
(
256
,),
(
v
,
w
,
Cx
,
Cy
,
Dx
,
Dy
,
Dz
,
Cx
.
size
,
Dx
.
size
,
egyensulyi_mtx
))
...
...
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