Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Rybar
athena
Commits
66fee03f
Commit
66fee03f
authored
5 months ago
by
Maxwell Cui
Committed by
Vakhtang Tsulaia
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update EFTracking FPGA pixel clustering to 64 bit format
Update EFTracking FPGA pixel clustering to 64 bit format
parent
a081ee12
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Trigger/EFTracking/EFTrackingFPGAIntegration/src/PixelClustering.cxx
+7
-20
7 additions, 20 deletions
...racking/EFTrackingFPGAIntegration/src/PixelClustering.cxx
with
7 additions
and
20 deletions
Trigger/EFTracking/EFTrackingFPGAIntegration/src/PixelClustering.cxx
+
7
−
20
View file @
66fee03f
...
@@ -31,13 +31,6 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
...
@@ -31,13 +31,6 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
ATH_CHECK
(
m_testVectorTool
->
prepareTV
(
m_inputTV
,
pixelTV
.
inputTV
));
ATH_CHECK
(
m_testVectorTool
->
prepareTV
(
m_inputTV
,
pixelTV
.
inputTV
));
ATH_CHECK
(
m_testVectorTool
->
prepareTV
(
m_refTV
,
pixelTV
.
refTV
));
ATH_CHECK
(
m_testVectorTool
->
prepareTV
(
m_refTV
,
pixelTV
.
refTV
));
// Convert input vector to 32-bit unsigned integers
std
::
vector
<
uint32_t
>
inputTV32
;
for
(
auto
&
elem
:
pixelTV
.
inputTV
)
{
inputTV32
.
push_back
(
static_cast
<
uint32_t
>
(
elem
));
}
// print the first 10 elements of the input vector
// print the first 10 elements of the input vector
for
(
int
i
=
0
;
i
<
10
;
i
++
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
{
...
@@ -45,14 +38,15 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
...
@@ -45,14 +38,15 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
}
}
// Prepare output vector
// Prepare output vector
std
::
vector
<
uint32_t
>
outputTV32
(
4096
,
0
);
// keep it the same size as the input vector for current development
std
::
vector
<
uint64_t
>
outputTV
(
pixelTV
.
inputTV
.
size
(),
0
);
// Work with the accelerator
// Work with the accelerator
cl_int
err
=
0
;
cl_int
err
=
0
;
// Allocate buffers on accelerator
// Allocate buffers on accelerator
cl
::
Buffer
acc_inbuff
(
m_context
,
CL_MEM_READ_
WRITE
,
sizeof
(
uint
32
_t
)
*
4096
,
NULL
,
&
err
);
cl
::
Buffer
acc_inbuff
(
m_context
,
CL_MEM_READ_
ONLY
,
sizeof
(
uint
64
_t
)
*
pixelTV
.
inputTV
.
size
()
,
NULL
,
&
err
);
cl
::
Buffer
acc_outbuff
(
m_context
,
CL_MEM_READ_WRITE
,
sizeof
(
uint
32
_t
)
*
4096
,
NULL
,
&
err
);
cl
::
Buffer
acc_outbuff
(
m_context
,
CL_MEM_READ_WRITE
,
sizeof
(
uint
64
_t
)
*
outputTV
.
size
()
,
NULL
,
&
err
);
// Prepare kernel
// Prepare kernel
cl
::
Kernel
acc_kernel
(
m_program
,
m_kernelName
.
value
().
data
(),
&
err
);
cl
::
Kernel
acc_kernel
(
m_program
,
m_kernelName
.
value
().
data
(),
&
err
);
...
@@ -63,7 +57,7 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
...
@@ -63,7 +57,7 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
// Make queue of commands
// Make queue of commands
cl
::
CommandQueue
acc_queue
(
m_context
,
m_accelerator
);
cl
::
CommandQueue
acc_queue
(
m_context
,
m_accelerator
);
acc_queue
.
enqueueWriteBuffer
(
acc_inbuff
,
CL_TRUE
,
0
,
sizeof
(
uint
32
_t
)
*
4096
,
inputTV
32
.
data
(),
NULL
,
NULL
);
acc_queue
.
enqueueWriteBuffer
(
acc_inbuff
,
CL_TRUE
,
0
,
sizeof
(
uint
64
_t
)
*
pixelTV
.
inputTV
.
size
(),
pixelTV
.
inputTV
.
data
(),
NULL
,
NULL
);
err
=
acc_queue
.
enqueueTask
(
acc_kernel
);
err
=
acc_queue
.
enqueueTask
(
acc_kernel
);
...
@@ -71,20 +65,13 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
...
@@ -71,20 +65,13 @@ StatusCode PixelClustering::execute(const EventContext &ctx) const
// The current implementation of the kernel Read/Write the same buffer
// The current implementation of the kernel Read/Write the same buffer
// So the line below reads the inbuff insatead of outbuff
// So the line below reads the inbuff insatead of outbuff
acc_queue
.
enqueueReadBuffer
(
acc_inbuff
,
CL_TRUE
,
0
,
sizeof
(
uint
32
_t
)
*
4096
,
outputTV
32
.
data
(),
NULL
,
NULL
);
acc_queue
.
enqueueReadBuffer
(
acc_inbuff
,
CL_TRUE
,
0
,
sizeof
(
uint
64
_t
)
*
outputTV
.
size
()
,
outputTV
.
data
(),
NULL
,
NULL
);
// Quick validation
// Quick validation
// Print the fist 10 elements of output vector
// Print the fist 10 elements of output vector
for
(
int
i
=
0
;
i
<
10
;
i
++
)
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
{
ATH_MSG_DEBUG
(
"outputTV["
<<
std
::
dec
<<
i
<<
"] = "
<<
std
::
hex
<<
outputTV32
[
i
]);
ATH_MSG_DEBUG
(
"outputTV["
<<
std
::
dec
<<
i
<<
"] = "
<<
std
::
hex
<<
outputTV
[
i
]);
}
// Convert the output vector to 64-bit unsigned integers
std
::
vector
<
uint64_t
>
outputTV
;
for
(
auto
&
elem
:
outputTV32
)
{
outputTV
.
push_back
(
static_cast
<
uint64_t
>
(
elem
));
}
}
// Compare the output vector with the reference vector
// Compare the output vector with the reference vector
...
...
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