Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ParticleGenerator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HASPEKIAN Yvan
ParticleGenerator
Commits
ce93ac14
Commit
ce93ac14
authored
1 year ago
by
BATON Theau
Browse files
Options
Downloads
Patches
Plain Diff
Correct linear curve GPU sided
parent
902f8338
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CurveTools/src/GPU/Core/Lineargenerator.cu
+16
-5
16 additions, 5 deletions
CurveTools/src/GPU/Core/Lineargenerator.cu
with
16 additions
and
5 deletions
CurveTools/src/GPU/Core/Lineargenerator.cu
+
16
−
5
View file @
ce93ac14
...
...
@@ -10,21 +10,32 @@ namespace ct::gpu {
:
StreamedGenerator
()
{}
__host__
Point
LinearGenerator
::
generate
(
const
thrust
::
universal_vector
<
Point
>
&
ctrlPoint
,
const
float
t
)
const
{
if
(
ctrlPoint
.
empty
())
{
return
Point
(
0.0
);
}
size_t
max_size
=
ctrlPoint
.
size
();
if
(
max_size
==
1
)
{
return
Point
(
ctrlPoint
[
0
].
x
,
ctrlPoint
[
0
].
y
,
ctrlPoint
[
0
].
z
);
}
float
range
=
1.f
/
static_cast
<
float
>
(
max_size
);
size_t
current
=
0
;
for
(
float
i
=
0.f
;
i
<
=
t
;
i
+=
range
)
{
for
(
float
i
=
0.f
;
i
<
t
;
i
+=
range
)
{
++
current
;
}
if
(
current
==
max_size
)
{
--
current
;
if
(
current
==
0
)
{
++
current
;
}
if
(
current
>=
max_size
)
{
current
=
max_size
-
1
;
}
Point
p1
=
ctrlPoint
[
current
];
Point
p2
=
ctrlPoint
[
current
+
1
];
Point
p1
=
ctrlPoint
[
current
-
1
];
Point
p2
=
ctrlPoint
[
current
];
Point
r
,
*
d_r
;
cudaMalloc
(
&
d_r
,
sizeof
(
Point
));
...
...
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