|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include <CL/cl_ext.h>
21 return StatusCode::SUCCESS;
35 for (
int i = 0;
i < 10;
i++)
42 std::vector<uint64_t> outputTV(pixelTV.
inputTV.size(), 0);
49 cl::Buffer acc_outbuff(
m_context, CL_MEM_READ_WRITE,
sizeof(
uint64_t) * outputTV.size(), NULL, &
err);
53 acc_kernel.setArg<
uint>(0, 0);
54 acc_kernel.setArg<cl::Buffer>(1, acc_inbuff);
55 acc_kernel.setArg<cl::Buffer>(2, acc_outbuff);
60 acc_queue.enqueueWriteBuffer(acc_inbuff, CL_TRUE, 0,
sizeof(
uint64_t) * pixelTV.
inputTV.size(), pixelTV.
inputTV.data(), NULL, NULL);
62 err = acc_queue.enqueueTask(acc_kernel);
68 acc_queue.enqueueReadBuffer(acc_inbuff, CL_TRUE, 0,
sizeof(
uint64_t) * outputTV.size(), outputTV.data(), NULL, NULL);
72 for (
int i = 0;
i < 10;
i++)
74 ATH_MSG_DEBUG(
"outputTV[" << std::dec <<
i <<
"] = " << std::hex << outputTV[
i]);
80 return StatusCode::SUCCESS;
std::vector< uint64_t > refTV
cl::Device m_accelerator
Device object for the accelerator card.
virtual StatusCode initialize() override
Detect the OpenCL devices and prepare OpenCL context.
StatusCode execute(const EventContext &ctx) const override
Should be overriden by derived classes to perform meaningful work.
cl::Context m_context
Context object for the application.
Gaudi::Property< std::string > m_refTV
Reference TestVector.
Class for the pixel clustering kernel.
StatusCode initialize() override
Detect the OpenCL devices and prepare OpenCL context.
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Gaudi::Property< std::string > m_kernelName
Kernel name.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_inputTV
Input TestVector.
StatusCode loadProgram(const std::string &xclbin)
Find the xclbin file and load it into the OpenCL program object.
StatusCode precheck(std::vector< Gaudi::Property< std::string >> inputs) const
Check if the the desired Gaudi properties are set.
ToolHandle< TestVectorTool > m_testVectorTool
Tool handle for TestVectorTool.
cl::Program m_program
Program object containing the kernel.
std::vector< uint64_t > inputTV